These instructions let you generate ogg, webm and mp4 formats playable by all mayor borwsers:
If you are in a mac, I recommend you to install homebrew:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
With home brew you can easily install ffmpeg, but its important to install it with the codecs for ogg and webm:
brew install --with-theora --with-libvorbis --with-libx264 --with-x264 --with-libvpx ffmpeg
If you don't have hombrew or mac, you can download and install ffmpeg manually: https://www.ffmpeg.org/download.html
ffmpeg -i SourceVideo.mp4 -c:v libtheora -c:a libvorbis -q:v 10 -q:a 10 NewVideo.ogg
ffmpeg -i SourceVideo.mp4 -c:v libvpx -b:v 1M -c:a libvorbis NewVideo.webm
ffmpeg -i SourceVideo.mp4 -c:v libx264 NewVideo.mp4
If you want to reduce the size of the video, you can use the flag -s
ffmpeg -i SourceVideo.mp4 -c:v libx264 -s 838x472 NewVideo.mp4
If you want to reduce the quality you can use the flags -b:a
and -b:v
to change the bit rate of the audio and the video:
ffmpeg -i SourceVideo.mp4 -c:v libx264 -b:a 128k -b:v 1200k NewVideo.mp4