Converting video (AVI, MOV, MPG, MP4) to FLV using FFmpeg

Firstly you need to download FFmpeg from the FFmpeg website

To convert your file use the following command.

ffmpeg -i "C:\videos\videoname.mov" -ar 44100 -ab 96 -f flv "C:\videos\videoname.flv"

  • ffmpeg - runs the program
  • -i "filename.ext" - input file
  • -ar 44100 - audio frequency
  • -ab 96 - audio bitrate
  • -f flv - force format followed by format
  • "newfilename.ext" - output file

I used these settings to convert some 500MB+ Apple Quicktime (MOV) files down to ~20MB FLV which were perfect for uploading to YouTube.

Comments

Thanks - your command worked fine with MP4 videos as well

Thanks!

I did a batch conversion using your parameters for MP4 to FLV. Used:

MP4_TO_FLV.BAT
---------------------------
IF EXIST "%1.flv" GOTO exit
ffmpeg -i %1 -ar 44100 -ab 96 -f flv %1.flv
:exit

BATCH_MP4_TO_FLV.BAT
---------------------------------------
for %%i IN (*.mp4) DO (mp4_to_flv.bat "%%i")

Only thing is the file name contains the old MP4 prior to FLV extension, ie myfile.mp4.flv. Manually removing ".mp4" from 90 files is not fun.

There are some tricks that you can do in a FOR loop to manipulate the filenames. Try something like:

for %%d in (*.mp4) DO ffmpeg -i %%d -ar 44100 -ab 96 -f flv %%~nd.flv

(note that this will not check for the destination file first..).

The %~nD gets JUSt the filename from the variable. See For /? for some more info on that.

The example is for windows, but works perfectly well for linux too. Thanks!

That's it, thank you!

I see this was posted some years ago but it worked flawlessly! I Had trouble getting .mov files to play in VLC due to the codec I think, I kept getting a blank screen with just audio. But this fixed all that, I can finally watch these video without having to mess around with quicktime. Thank you!