From: W. Trevor King Date: Sat, 2 Apr 2011 22:15:04 +0000 (-0400) Subject: Add video encoding post. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=182753c765642160beda6f989c8d44192b2277f0;p=blog.git Add video encoding post. --- diff --git a/posts/video.mdwn b/posts/video.mdwn new file mode 100644 index 0000000..a5e5b02 --- /dev/null +++ b/posts/video.mdwn @@ -0,0 +1,54 @@ +[[!meta title="Video encoding for the web"]] + +According to [Mark Pilgrim][MP], video embedded in the following +manner should work for Firefox 3.5+ and Opera 10.5+ (playing the ogg +movie), Safari, iPhones, and Androids (playing the mp4 movie), and +Chrome 4+ playing either one. If you're not running one of those +browsers, you can download the video an extermal player (like +[VLC][]). + +My digital camera takes movies in + +* Container: mov,mp4,m4a,3gp,3g2,mj2 +* Video: mjpeg, yuvj420p, 640x480, 10422 kb/s, 30 tbr, 30 tbn, 30 tbc +* Audio: pcm_u8, 8000 Hz, 1 channels, s16, 64 kb/s + +Encode your movie with something like (tagging flags removed) + + ffmpeg2theora --endtime 120 --optimize movie.mov + + ffmpeg -i movie.mov -t 120 -acodec libfaac -aq 200 -ac 1 -s + 640x480 -vcodec libx264 -vpre slower -vpre ipod640 -b 800k -bt + 800k -aspect 640:480 -threads 0 movie.mp4 + +For `-vpre`, take a look in `/usr/share/ffmpeg/`, which usually +contains a bunch of pre-configured settings. The parameters for +baseling H.264 [should be][H264]: + +* H.264 Baseline: `avc1.42E0xx`, where xx is the AVC level +* Low-Complexity AAC: mp4a.40.2 + +You should use ffmpeg2theora v0.26 or greater, as v0.25 has +audio/visual syncing issues. + +To embed the movie, include something like: + + +

Download as + Ogg/Theora/Vorbis or + Mpeg4/H.264(ConstrainedBaselineProfile)/AAC. +

+ +[MP]: http://diveintohtml5.org/video.html +[VLC]: http://www.videolan.org/vlc/ +[H264]: http://wiki.whatwg.org/wiki/Video_type_parameters +[ipod]: http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/