PDA

View Full Version : How to convert FLV to MP4 losslessly with ffmpeg (Windows, Linux, Mac OS)


blimey
04-28-2010, 08:22 PM
Open command prompt (Terminal) and run:
ffmpeg -i "filename.flv" -vcodec copy -acodec copy "filename.mp4"
This will copy video track and audio track from filename.flv to filename.mp4. The operation is lossless (there is no quality loss).

Joe_Linux
10-27-2014, 10:34 AM
What would be the command to bulk process several files in a single folder?

JCMaxwell
07-11-2015, 12:14 AM
I know this thread is old, but in case anyone searches for this, I found a way to batch convert.

for %%a in ("*.flv") do ffmpeg.exe -i "%%a" -vcodec copy -acodec copy -metadata:s:a:0 language=eng "%%~na.mp4" -map_metadata -1
pause


Open notepad, copy this text and save it with file extension .bat

Make sure both this .bat file and ffmepg.exe are in the directory of the files you wish to batch convert and drag any of the .flv files onto the .bat file icon in the folder.

This will convert all .flv files to .mp4 files and "pause" when completed.

This code also strips all the metadata from the file; like "title" "artist" etc. and sets the language tag to "English".

yugioh626
12-05-2015, 08:52 AM
I know this thread is old, but in case anyone searches for this, I found a way to batch convert.

for %%a in ("*.flv") do ffmpeg.exe -i "%%a" -vcodec copy -acodec copy -metadata:s:a:0 language=eng "%%~na.mp4" -map_metadata -1
pause


Open notepad, copy this text and save it with file extension .bat

Make sure both this .bat file and ffmepg.exe are in the directory of the files you wish to batch convert and drag any of the .flv files onto the .bat file icon in the folder.

This will convert all .flv files to .mp4 files and "pause" when completed.

This code also strips all the metadata from the file; like "title" "artist" etc. and sets the language tag to "English".

JC I have a question if you are still around. I use the following for the same purpose (don Lorenzo posted it on kitty-kats(dot)net so I am not seen as stealing his stuff) for %%a in ("*.*") do ffmpeg -i "%%a" -c:v copy -c:a libvo_aacenc -b:a 128k "newfiles\%%~na.mp4"
pause
I dont understand code, but is it the same as yours or does your work better?

bat999
12-18-2015, 02:55 PM
... is it the same...
No, it's different.
JC's version keeps the original soundtrack without converting it, so it's genuinely lossless conversion.
Your version converts the soundtrack to aac (even though it might already be aac), so it's not lossless conversion.
To keep the original soundtrack tweak your code like this:-
for %%a in ("*.flv") do ffmpeg -i "%%a" -c copy "newfiles\%%~na.mp4"
If the flv files don't contain aac (check this with MediaInfo program) then stay with your original code.

yugioh626
12-28-2015, 02:18 PM
No, it's different.
JC's version keeps the original soundtrack without converting it, so it's genuinely lossless conversion.
Your version converts the soundtrack to aac (even though it might already be aac), so it's not lossless conversion.
To keep the original soundtrack tweak your code like this:-
for %%a in ("*.flv") do ffmpeg -i "%%a" -c copy "newfiles\%%~na.mp4"
If the flv files don't contain aac (check this with MediaInfo program) then stay with your original code.
Thank you. I wish I could understand these things more. I don't know how much script/program knowledge is required to make these command things work. I appreciate it. My first version kills Speex auto, so i will try this one.