Audio/video stream recording forums (http://stream-recorder.com/forum/index.php)
-   Converting audio/video files (http://stream-recorder.com/forum/forumdisplay.php?f=16)
-   -  

How to convert FLV to MP4 losslessly with ffmpeg (Windows, Linux, Mac OS)

(http://stream-recorder.com/forum/showthread.php?t=7137)

blimey 04-28-2010 07:22 PM

How to convert FLV to MP4 losslessly with ffmpeg (Windows, Linux, Mac OS)


 
Open command prompt (Terminal) and run:
Code:

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 09:34 AM

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


 
What would be the command to bulk process several files in a single folder?

JCMaxwell 07-10-2015 11:14 PM

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


 
I know this thread is old, but in case anyone searches for this, I found a way to batch convert.

Code:

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 07:52 AM

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


 
Quote:

Originally Posted by JCMaxwell (Post 78121)
I know this thread is old, but in case anyone searches for this, I found a way to batch convert.

Code:

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)
Code:

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 01:55 PM

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


 
Quote:

Originally Posted by yugioh626 (Post 81435)
... 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:-
Code:

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 01:18 PM

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


 
Quote:

Originally Posted by bat999 (Post 81771)
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:-
Code:

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.


All times are GMT -6. The time now is 06:55 PM.