Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Media file management > Converting audio/video files
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-28-2010, 07:22 PM
blimey blimey is offline
Former Member
 
Join Date: Jul 2006
Posts: 286
blimey is on a distinguished road
Default

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).
Reply With Quote
  #2  
Old 10-27-2014, 09:34 AM
Joe_Linux Joe_Linux is offline
Junior Member
 
Join Date: Oct 2014
Posts: 1
Joe_Linux is on a distinguished road
Default

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?
Reply With Quote
  #3  
Old 07-10-2015, 11:14 PM
JCMaxwell JCMaxwell is offline
Junior Member
 
Join Date: Jul 2015
Posts: 1
JCMaxwell is on a distinguished road
Default

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".
Reply With Quote
  #4  
Old 12-05-2015, 07:52 AM
yugioh626 yugioh626 is offline
Junior Member
 
Join Date: Jun 2015
Posts: 8
yugioh626 is on a distinguished road
Default

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


Quote:
Originally Posted by JCMaxwell View Post
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?
Reply With Quote
  #5  
Old 12-18-2015, 01:55 PM
bat999 bat999 is offline
Senior Member
 
Join Date: Apr 2011
Location: UK
Posts: 131
bat999 is on a distinguished road
Default

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


Quote:
Originally Posted by yugioh626 View Post
... 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.
Reply With Quote
  #6  
Old 12-28-2015, 01:18 PM
yugioh626 yugioh626 is offline
Junior Member
 
Join Date: Jun 2015
Posts: 8
yugioh626 is on a distinguished road
Default

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


Quote:
Originally Posted by bat999 View Post
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.
Reply With Quote
Reply Post New Thread
Tags: , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:39 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons