Strict Standards: Redefining already defined constructor for class wpdb in /home/thornock/public_html/wordpress/wp-includes/wp-db.php on line 52

Deprecated: Assigning the return value of new by reference is deprecated in /home/thornock/public_html/wordpress/wp-includes/cache.php on line 36

Strict Standards: Redefining already defined constructor for class WP_Object_Cache in /home/thornock/public_html/wordpress/wp-includes/cache.php on line 389

Strict Standards: Declaration of Walker_Page::start_lvl() should be compatible with Walker::start_lvl($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::end_lvl() should be compatible with Walker::end_lvl($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::start_el() should be compatible with Walker::start_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_Page::end_el() should be compatible with Walker::end_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 537

Strict Standards: Declaration of Walker_PageDropdown::start_el() should be compatible with Walker::start_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 556

Strict Standards: Declaration of Walker_Category::start_lvl() should be compatible with Walker::start_lvl($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::end_lvl() should be compatible with Walker::end_lvl($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::start_el() should be compatible with Walker::start_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_Category::end_el() should be compatible with Walker::end_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 653

Strict Standards: Declaration of Walker_CategoryDropdown::start_el() should be compatible with Walker::start_el($output) in /home/thornock/public_html/wordpress/wp-includes/classes.php on line 678

Deprecated: Assigning the return value of new by reference is deprecated in /home/thornock/public_html/wordpress/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/thornock/public_html/wordpress/wp-includes/theme.php on line 508

Strict Standards: Non-static method GoogleSitemapGenerator::Enable() should not be called statically in /home/thornock/public_html/wordpress/wp-content/plugins/sitemap.php on line 2452

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_query_vars() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_where() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_posts_join() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 57

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_tag_templates() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 160
Gary Thornock's Weblog » Flash video encoding with ffmpeg
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_add_ajax_javascript() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 160
19th Feb, 2008

Flash video encoding with ffmpeg


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/thornock/public_html/wordpress/wp-includes/formatting.php on line 74

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method UltimateTagWarriorActions::ultimate_the_content_filter() should not be called statically in /home/thornock/public_html/wordpress/wp-includes/plugin.php on line 57

I just had occasion to convert a handful of MPEG-1 videos to Flash video format, and I thought I'd better document how I did it because I'm certain to need to do it again.

The main tool I used was ffmpeg, which I needed to compile and install on my Powerbook. Because I expect to want to use ffmpeg with a few additional features, I installed slightly more than what was strictly necessary for this project (ffmpeg and libmp3lame would have been enough this time around).

  1. libmp3lame was already installed. If it hadn't been, the source code is available at lame.sourceforge.net. It's a fairly simple ./configure ; make ; sudo make install process.
  2. libogg and libvorbis were also already installed. If they hadn't been, I'd have gone looking for the code at xiph.org.
  3. libtheora wasn't installed. Once again, the code is at xiph.org, and it's a simple configure, make, make install.
  4. libx264 wasn't installed. That code needed to come from Subversion:
    svn export svn://svn.videolan.org/x264/trunk x264
    Once again, a simple configure, make, make install.
  5. The ffmpeg code itself also comes from Subversion, and the configure command requires a few extra switches:
    svn export svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
    cd ffmpeg
    ./configure --enable-libmp3lame --enable-gpl --enable-libx264 --enable-libtheora --enable-libvorbis
    make
    sudo make install
  6. Once the software was installed, the actual conversion was a fairly simple shell script:
    for i in *mpg
    do
      ffmpeg -i "${i}" -ar 22050 -ab 96 -aspect 4:3 -r 12 -f flv -s 320x240 -acodec libmp3lame -ac 1 "${i}.flv"
    done

These steps were based on this older post, with some updates required because of changes in ffmpeg options and because I wanted to add in Vorbis, Theora and x264 support in my ffmpeg build.

Update: the code for x264 is now in git rather than Subversion. Download it with git clone git://git.videolan.org/x264.git

Another update (2009-12-10): There are good instructions for Snow Leopard at http://www.martinlos.com/?p=41. In particular, it's worth noting that yasm (and possibly the updated nasm) are helpful in the installation process.

, ,

Comments are closed.

Categories