Convert flash video to Android format with ffmpeg

by cs

If your flash video is already in a format that Android can read, such as h264/x264, there’s no reason to recode the whole file. You can simply copy the video and audio streams into a new container that Android can make sense of.

  • Check the audio and video codecs:
    $ ffmpeg -i flashvideo.f4v
  • Copy the streams into a new container:
    $ ffmpeg -i flashvideo.f4v -vcodec copy -acodec copy mp4video.mp4
  • Make your file streamable. This is optional but convenient if you want to check that your device can read the file as soon as you’ve started pushing it.
    $ qt-faststart mp4video.mp4 mp4video_fs.mp4
  • Push to your Android device:
    $ adb push mp4video_fs.mp4 /sdcard/DCIM/Camera/

In case this fails and you have to recode the file, here are some rather outdated links. On more recent devices, you should be able to encode at a higher resolution than 432×240, and x264 will give you considerably smaller files than mpeg4.
Encoding Video for Android on Ubuntu Community Documentation
Convert videos to G1 compatible format with FFMPEG in Ubuntu