Adding audio to multiple mp4 files using mp4box

267 Views Asked by At

I am trying to add the same audio file to a large number of mp4 files (that currently have NO audio stream).

I am pretty sure I have used the following code (in a .bat file) successfully in the past:

for %%a in (*.mp4) do mp4box %%a -add 1sSilenceM.mp3 pause

However, when I try to run it now I am getting this error:-

"Error - 2 input names specified, please check usage"

Can anyone explain why it no longer works (or tell me what is wrong with it)?

Thanks

1

There are 1 best solutions below

13
Brian Cameron On

Hmmmm,

After much fiddling about (and some further research on the internet) I added quotation marks to the filename variable (%%a) after the mp4box command and this has solved the problem. So the code now looks like this:-

for %%a in (*.mp4) do mp4box "%%a" -add 1sSilenceM.mp3 pause

I don't understand why this has now become necessary as the batch file used to run perfectly before (on Win 10 and earlier). Could it be something to do with some update to Win 10?

Anyone who can offer any insight(s) I'd be glad to hear them.

My thanks to any & all readers/contributors.