audio – ffmpeg single mp4 with 6 channels convert to mkv with 6 channels plus 2 channels
I have a single mp4 video with a single audio index of 6 channels. I confirmed with this ffprobe. My goal is to have a single mkv file keeping the original 6 channel audio index, but also adding a 2 channel audio index. So that I can pick which one I want based on which tv will be watching and if they have surround sound or not. Is this possible?
I’ve been searching for this, but have not found instructions on how to do this exactly. The closest instructions I found suggests adding multiple audio index’s for multiple languages by adding multiple audio files along with the input video. Similar to ffmpeg -i video.mp4 -i audio1.mp3 -i audio2.mp3 -map 0 -map 1 -map 2 -codec copy output.mp4. But I don’t have individual audio files.
Do I need to somehow extract the original 6 channel audio first? And then convert it into a 2 channel and input both? I thought I would check with the community first if ffmpeg was capable of doing this from the original audio tracks.
Here is my current ffmpeg command which is only converting from 6 channel to 2 channel.
Side note: I’m also converting from mp4 to mkv and from H.x264 to H.x265. I can live without that if it’s not possible to do ALL of these things in one sweep.
ffmpeg -i input.mp4 \
-map 0 \
-c copy \
-c:a aac \
-ac 2 \
-c:v libx265 \
-crf 16 output.mkv
Read more here: Source link
