Hey guys, so I have a folder of videos that have a H.264 codec, but contain an AVI wrapper. I decided I want to convert them all to have a MP4 wrapper.
I noticed initially using this code:
@ECHO OFF
for %%a in (*.avi) do ffmpeg -i "%%a" -vcodec copy -acodec copy -f mp4 -y "%%~na".mp4
Some files will convert just fine, however, others will stay at 1KB and it will simply move to the next file. So, upon scrolling, I also tried this code:
@ECHO OFF
for %%a in (*.avi) do ffmpeg -i "%%a" -vcodec copy -f mp4 -y "%%~na".mp4
With this code, all my files converted successfully. I did notice however that the original bit rate of the audio of the AVI wrapped files were 192kb. However, the audio of the MP4's are only 131KB. Thus, I'm not sure if I'm now losing audio quality.
Is there a way to add to this code, or is it because it is recompiling the audio in the second code that is causing the issue?
+ Reply to Thread
Results 1 to 7 of 7
-
-
What is the audio codec in the files that doesn't work with the first command? Check the avi with for example MediaInfo.
You can addCode:-b:a 192k
And if you want to set the audio codec use aac audioCode:-c:a libfdk_aac
Last edited by Baldrick; 31st May 2016 at 02:19.
-
I think I figured out the issue for the code not working for all the files. For the files that worked with this code, they had the MPEG Audio (MP3) codec. The ones that stayed at 1KB, had this audio codec: AC-3.
Could you show me where I would add the bit rate code: -b:a 192k in this code, and what if I want to have all the files have the MPEG Audio (MP3) codec? Is there a way to do that as well.
Code:@ECHO OFF for %%a in (*.avi) do ffmpeg -i "%%a" -vcodec copy -acodec copy -f mp4 -y "%%~na".mp4
-
Similar Threads
-
FFMPEG capture question
By Todd123 in forum Capturing and VCRReplies: 0Last Post: 23rd May 2016, 04:31 -
FFMPEG QUESTION :How do I take 10bit jpeg with FFMPEG?
By Jamaika in forum Video ConversionReplies: 10Last Post: 6th Jul 2015, 13:41 -
ffmpeg overlay question
By Basher06 in forum Newbie / General discussionsReplies: 0Last Post: 19th Jun 2015, 04:52 -
ffmpeg 2-pass question
By DamienS in forum Video ConversionReplies: 18Last Post: 1st Dec 2013, 21:44 -
AVANTI (FFMPEG) Question
By erichollis in forum Video ConversionReplies: 1Last Post: 18th Aug 2011, 15:54