A3.2 Encoding Video
You need to encode your video files to multiple formats if you want to reach
every platform when using HTML5 video. Encoding to H.264, Theora, and
VP8 can be time-consuming, both in terms of setting up an open source
encoder like FFmpeg and actually running the encoding jobs.^4 We don’t have
enough pages to properly explain this command, which converts a file to VP8
and Vorbis audio using the WebM container:
ffmpeg-i blur.mov
-f webm-vcodeclibvpx_vp8-acodeclibvorbis
-ab 160000-sameq
blur.webm
If you don’t want to mess with the settings yourself, you can use the web
service Zencoder to encode your videos to all the formats necessary for use
with HTML5 video.^5 You place your video on Amazon S3 or another location,
and you can then set up jobs to encode that video file to multiple formats
using the web interface or application programming interface calls. Zencoder
will fetch the video files, do the encoding, and then transfer the new videos
back to your servers. The service is not free, but it produces excellent results
and can save you a great deal of time if you have a lot of content to encode.^6
Miro Video Converter is an excellent, free option.^7 It has presets for converting
your video files to multiple outputs and can do batch encoding.
Encoding video to multiple formats is a time-consuming process, so be sure
your video is complete and correct before you press that Encode button. If
possible, encode small chunks of your videos and test them to find the right
settings.
- http://www.ffmpeg.org/
- http://www.zencoder.com/
- Full disclosure: I know a couple of developers at Brightcove, the company that owns
Zencoder. I would still recommend the service if that weren’t the case. - http://www.mirovideoconverter.com/
Appendix 3. Encoding Audio and Video for the Web • 274
Download from Wow! eBook <www.wowebook.com> report erratum • discuss