0

I have a folder of video files listing:

1H.mp4; 1L.mp4; 2H.mp4; 2L.mp4; ....

The sounds are unbalanced for two ears - it is probably due to the recording is stereo. How can I change the audio tracks from stereo to mono for all the video files?

I assume the workflow would be extract (copy) the audio tracks out, change to mono, then insert (copy) back. I have found codes for individual files, but with hundreds of such short mp4 files, I'd like to know if I can use a 'loop' to deal with them all.

Thank you!

0

No need to extract, you can downmix two audio channels and keep video channel and generate a new file in one command.

ffmpeg -i input.mp4 -c:v copy -ac 1 mono-output.mp4

Here -ac 1 says 1 audio channel, downmixed from stereo, look in ffmpeg docs. Now make a loop. Assuming you are using bash or similar unix shell

for i in *.mp4; do ffmpeg -i $i -c:v copy -ac 1  mono-$i; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.