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!

1 Answer 1

2

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
2
  • Is there a way to do this without re-encoding the audio? (I assume not, ∵ lossy stereo codecs are a single stream.)
    – Geremia
    May 23, 2022 at 23:28
  • @Geremia it is not re encoded, the stream is simply copied Sep 14, 2022 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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