Log in

View Full Version : FLV batch convertion to AVI (another script is needed, plz)


alexVS
21st October 2013, 14:09
Hello!

I need to convert bunch of FLV files into AVI to be able to watch them on TV. I want to simplify all the operations.
So I put all FLV files into folder, run CMD files and got AVI files.

Here I found a script (BIG thanks to author!!!)

setlocal

REM Where to Find ffmpeg
set FFMPEG="C:\BIN\ffmpeg.exe"

REM Where to get input file, No terminating Backslash, "." = current directory
set INDIR="."

REM Where to place output file, No terminating Backslash.
set OUTDIR=".\OUTPUT"

FOR %%A IN (*.wmv *.mpg *.avi *.flv *.mov *.mp4 *.m4v *.RAM *.RM) DO (
%FFMPEG% -i "%INDIR%\%%A" -c:v mpeg4 -b:v 1400k -vtag xvid -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 "%OUTDIR%\%%~nxA.AVI"
)


Here I have some question:
1) I receive output filenames as "original.flv.AVI". How can I get "original.avi" ?

2) How can I indicate to coder that I want to use trellis quantization, motion search precision=6, VHQ mode=1 etc.


Are the any other command line converters (faster, better quality) FLV to AVI?
And if you have a link+cmd script(like this above), post it, please. Sometimes it's so difficult to make easy things to work right. :)

Thanks in advance!

StainlessS
21st October 2013, 15:39
1)

%FFMPEG% -i "%INDIR%\%%A" -c:v mpeg4 -b:v 1400k -vtag xvid -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 "%OUTDIR%\%%~nA.AVI"


but input files eg fred.flv + fred.wmv would overwrite each other, keeping original extension avoids that and any 'overwrite ?' type prompt.

Sorry cannot help on (2), see ffmpeg docs.

see here for possible original source batch file + a little explanation.

From Command line type "HELP for", and press key to continue (its a long doc), to see info on the weird "%%~nxA" type stuff.

raffriff42
21st October 2013, 16:01
If you are using a software media player, can't it play FLV's natively? If you are using a hardware player, what are its exact requirements? File format, resolution, bit rate etc?

What is the format of these FLV's? Examine them with MediaInfo. Chances are *ahem* they are H.264 video + AAC audio, which can be remuxed to .MP4 without re-encoding
ffmpeg -c:v copy -c:a copy "%OUTDIR%\%%~nA.MP4"

StainlessS
21st October 2013, 17:27
Oooops, forgot the link in previous post, here:
http://forum.doom9.org/showthread.php?t=163289&highlight=mediainfo+aspect+ratio

alexVS
21st October 2013, 20:18
StainlessS
Thanks! %%~nA.avi works fine!
Opened the link, kinda difficult for me :)

raffriff42
ffmpeg -c:v copy -c:a copy "%OUTDIR%\%%~nA.MP4"
Looks really easy to change container from FLV to MP4.
But in my case (hardware XORO and LG players) they understand only AVI, and source is FLV(avc+aac), so I need to reencode.

Paramerers of AVI is usual for old hardware: XVID, no more then 720 points in width, no quarterpixel and something else I don't remember. Sound mp3 CBR 128-192kbps is OK for me.