Using FFMPEG to Encode Video for iPod, iPhone Streaming, and Flash 9 – Saved from google cache

/* Posted April 14th, 2009 at 10:17am */
/* Filed under General */

/* */

Using FFMPEG to Encode Video for iPod, iPhone Streaming, and Flash 9
by Nick Gauthier

Read on to learn how to encode videos in to H264 for use by Flash 9, and also to stream to an iPhone in Safari, and be able to sync them onto an iPod.

First, you need FFMPEG compiled with H264 support. This is the thread I followed for Ubuntu:

http://ubuntuforums.org/showthread.php?t=786095

Next, you can use this command to encode the video:

ffmpeg -y -i INPUT -vcodec libx264 -acodec libfaac -ab 128k -ac 2 -b 640 -threads 4 -flags +loop -cmp +chroma -partitions 0 -me epzs -subq 1 -trellis 0 -refs 1 -coder 0 -me_range 16 -g 300 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -maxrate 10M -bufsize 10M -rc_eq \’blurCplx^(1-qComp)\’ -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 OUPUT

The -vcodec and -acodec options specify the h264 encoder with aac audio. -ab is audio bitrate, if you want to change that, and -b is the video bitrate. You can also specify a size with “-s widthxheight” for instance “-s 640×480?. The -threads option gives you multithreading, I run a quad-core so I have it at 4. All the other flags are h264 options for higher quality. I don’t understand many of them, but it looks nicer with them on.

If you want, you can add “-pass 1? to the command and run it, and it will generate a log file. Then run it again with “-pass 2? and it will use the log file for superior variable bitrate results. I highly suggest this.

Lastly, you should pack up the file for iPhone and iPod compatibility:

AtomicParsley OUTPUT -iPod-uuid 1200 –overWrite

Where OUTPUT is the file that you generated with FFMPEG.

  • Twitter
  • Digg
  • del.icio.us
  • Propeller
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Mixx
  • Yahoo! Buzz
  • NewsVine
  • Facebook
  • Google Bookmarks

Related Posts


Related Stories

2 Responses to “Using FFMPEG to Encode Video for iPod, iPhone Streaming, and Flash 9 – Saved from google cache”

  • [...] Using FFMPEG to Encode Video for iPod, iPhone Streaming, and Flash 9 – Saved from google cache § … Using FFMPEG to Encode Video for iPod, iPhone Streaming, and Flash 9 by Nick Gauthier Read on to learn how to encode videos in to H264 for use by Flash 9, (tags: ffmpeg iphone) AKPC_IDS += "777,"; Mogelijk gerelateerde artikelen: [...]

  • Comment from Travis

    I copy and pasted your code into a terminal and replace only the INPUT and OUTPUT parameters. I got this error:

    bash: syntax error near unexpected token `(’


Leave a Reply

or Login (not required)





HTML tags allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>