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:
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:
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:
And if you want to set the audio codec use aac audioCode:
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.
@ECHO OFF for %%a in (*.avi) do ffmpeg -i "%%a" -vcodec copy -acodec copy -f mp4 -y "%%~na".mp4
Awesome, thank you so much for your help!