linux poison RSS
linux poison Email

How To convert flv to avi Using FFmpeg

Move to the path where you have your video files:
cd /path/where/is/the/video

Run ffmpeg command with -i for input and output.avi is the output file in avi or mpg:
# ffmpeg -i input.flv output.avi

What is FFmpeg?
"FFmpeg is a collection of software libraries that can record, convert and stream digital audio and video in numerous formats. It includes libavcodec, an audio/video codec library used by several other projects, and libavformat, an audio/video container mux and demux library."


15 comments:

Anonymous said...

doesn't work!

Unsupported video codec!

Reed said...

Works great for me. Thanks of the tip.

Taiyoko said...

Anon, try going back into your package manager and selecting the "unstripped" versions of the packages. This is what I had to do to get it to get rid of the "Unsupported codec" message.

Anonymous said...

It works, but how do you batch convert all the .flv's in a given folder?

Anonymous said...

> It works, but how do you batch convert all the .flv's in a given folder?

bash#: for FILE in *.avi; do ffmpeg -i "$FILE" "$FILE.avi"; rm "$FILE"; done

Anonymous said...

Just looking at the above definitely won't work...in fact if you have avi files in there already it will delete them all and the new ones you created.

To convert all the flv files in a directory to avi run the following.
for i in *.flv ; do ffmpeg -i "${i}" "${i}.avi" ; done

Anonymous said...

come on guys, wrong scripts, for both of you

you will get file.flv converted to file.flv.avi

you have to strip .flv from the name

ls *.flv | sed 's/.flv//' | while read a; do
ffmpeg -i $a.flv -sameq $a.avi
done

-sameq should keep same quality in output as in input

Anonymous said...

I have it running now. I wonder how do I batch convert a bunch of files?

Anonymous said...

quick and dirty (and tested):

(for I in *.flv; do ffmpeg -i "$I" -sameq "${I%.flv}.avi"; done)

If there's no audio, you might need to add -an in the output section (e.g. after -sameq). The parens make it easy to stop and restart the job - you can leave them out if you put it in a shell script.

ffmpeg with apache-PHP said...

hi
i wanna use ffmpeg with apache server and PHP
i have C++ program in client side used wget to send requests to the server to downloding files
how can convert the files format before send them to client..any help..

Trebor said...

Hi! is the output from the last script (Watkins) viewable on a DVD-Player (Television DVD-Player :-) )
great thanks...

Diego said...

Thanks it works for me!!! ^^

Anonymous said...

Gonna try this since I have a video file that only plays for 1 second. and hopefully I'll learn something new when I get this right.

kiki said...

as for me, i usually use this flash to video converter http://www.macvide.com/Macvide_FlashVideo_Converter/, i heard a lot of nice reviews about it!) but thanx for info)

Anonymous said...

Works perferctly, thanks

FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1.1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --extra-version=4:0.5.1-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static

Post a Comment

Related Posts with Thumbnails