Despite all the hype, in reality the HTML5 video tag has a bit of a problem. In order to use it and for it to be cross browser compatible, you have to include more than one format of the video. To target all supported browsers these formats are mp4 and ogg.
I was searching around for optimum settings for each format but unfortunately I couldn't find any. I'm using ffmpeg 0.6 which has the tagline "Works with HTML5". I'm no video expert so I was wondering if anyone could recommend decent settings for each format?
The ffmpeg software is a free and open source suite of utilities that facilitate audio and video media. On Linux systems, installing ffmpeg gives us access to the ffmpeg command, which can be used to convert audio files to various types, such as wav, mp3, ogg, etc.
Instead of -sameq (removed by FFMpeg), use -qscale 0 : the file size will increase but it will preserve the quality.
FFmpeg can input most container formats natively, including MP4, . ts, MOV, AVI, Y4M, MKV, and many others. This is the output file.
I ended up using ffmpeg and ffmpeg2theora.
I decided to go for the ipod640 preset because it means the video can be viewed nicely on an iPhone or iPod touch. Of course, you can change the settings around a bit, get rid of the '-vpre ipod640', change the resolution or quality. Anyway the command is:
ffmpeg -i video_source_file.ext -vcodec libx264 -vpre ipod640 -b 250k -bt 50k -acodec libfaac -ab 56k -ac 2 -s 480x320 video_out_file.mp4
move some information to the front of the file so the video can play before it loads
qt-faststart video_out_file.mp4 video_out_file_quickstart.mp4
This depends on you having ffmpeg2theora installed. Also, I have only tested it with the input file being the output file from the previous ffmpeg conversion. The command is:
ffmpeg2theora -o video_out_file.ogv video_out_file.mp4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With