First install FFmpeg by running the following in a Terminal window:
sudo apt-get install ffmpeg
Then change to the same folder as your mp4 file(s) and run either of the following:
1. For a single mp4 file:
ffmpeg -i input.mp4 -c:v libtheora -qscale:v 6 -c:a libvorbis -qscale:a 5 output.ogv
Of course change input.mp4
to the actual filename of your input video file!
2. For many mp4 files:
mkdir ogv && \
for j in *.mp4
do
ffmpeg -i "$j" -c:v libtheora -qscale:v 6 -c:a libvorbis -qscale:a 5 ogv/"${j%.mp4}.ogv"
done
Options to experiment with:
-qscale:v
(for video quality) takes integers from 0 - 10 with 0 being lowest quality and 10 the highest quality
-qscale:a
(for audio quality) takes integers from 0 - 10 with 0 being lowest quality and 10 the highest quality
And enjoy the feeling of using libtheora and libvorbis, both codecs completely unencumbered and totally free :)
References: