Flash Video Conversion

I came across a very fast flash (flv) to avi/mov conversion tool today. An online interface to the tool is available at http://vixy.net/ while the source code to the tool itself has been released and can be downloaded from the vixynet sourceforge site

The compilation instructions that came with the source had some missing linker dependencies. So here’s what worked for me:

$ svn co https://vixynet.svn.sourceforge.net/svnroot/vixynet/trunk vixynet
$ cd vixynet/flv2mpeg4/src
$ gcc -O3 -o flv2mpeg4 avformat_writer.c dcprediction.c flv2mpeg4.c fetch.c flvdecoder.c \
  m4vencode.c mp3header.c -lm -lpthread -lavformat -lavcodec -lavutil -lfaac -lvorbisenc \
  -lvorbis -ltheora -lgsm -lmp3lame -lx264 -lxvidcore  -ldc1394_control -lfaad -ldts -lz \
  -I /usr/local/include/ffmpeg/
$ cp flv2mpeg4 ~/local/bin

That’s all! You can now convert a flash video file with the command flv2mpeg4 in.flv out.avi

It took just six seconds to convert a 28 MB, 11 minutes long flash video to a divx avi file. That’s fast in my book!

I repurposed a shell script around flv2mpeg4 to make batch conversions easy:

#!/bin/sh
#flv2avi.sh

if [ -z "$1" ]; then
    echo "Usage: $0 list_of_flv_files"
    exit 1
fi

while [ "$1" ]; do
    if file "$1" | grep -q "Macromedia Flash Video"; then
        BasName=`basename "$1" .flv`
        NewName=`echo "$BasName" | tr ' ' '_'`
        flv2mpeg4 "$1" "${NewName}.avi"
        mv ${NewName}.avi "${BasName}.avi"
    else
        echo "$1 is not Flash Video. Skipping"
    fi
    shift
done

While we are here, let me point you to the great All-In-One Video Downloader.