Archive for May, 2010

From Flash to MP4

May 25, 2010

I’ve been thinking about saving some Flash videos from YouTube, Vimeo (videos without a download link), and other sites for playing on iPods and other platforms that don’t support Flash video. Since most Flash video these days uses the h.264 codec, it should be possible to de-multiplex the .flv file to extract the video and audio streams, then re-multiplex them into an MP4 container, with no re-encoding.

On a Mac with Perian and QuickTime Pro installed, just open the .flv file in QuickTime Player 7, do “Save As,” choose “self-contained movie,” and after a few seconds, you’ll get a copy of the video in a QuickTime .mov file.

There’s also a more roundabout way to do it on Windows, if you really want a .mp4 container file.

  1. Download the Flash video file (.flv extension). The Firefox add-on DownloadHelper is one way to do this. You should probably download the highest-resolution version available.
  2. Run FLV Extract and drop the .flv file onto it to create .264 and .aac files, which contain the video and audio respectively. If it produces files with different extensions, your Flash video file isn’t encoded in h.264 so the next step won’t work, sorry.
  3. Run YAMB and add the .264 and .aac files to re-multiplex them into a .mp4 file.
  4. Play the .mp4 file and check that audio and video stay in sync before you delete the .flv file.