[FFmpeg-user] Audio mapping

Kasper Folman pneu at pneu.dk
Thu Jun 7 12:18:53 EEST 2018


Hi.

I’m having some issues properly mapping audio in a quicktime.
Say I just wan’t to create a mov file with 2 mono audio tracks.

This command creates the correct file.
ffmpeg -t 1  -i "/Volumes/Storage/_MoveToBackup/formatSamples/1x16-chAudioTest.mov" -filter_complex "[0:0]copy,fps=25,setfield=prog,setdar=dar=16/9,setsar=sar=1/1[vOut]" -c:a pcm_s32le -map 0:1 -filter:a:0 "pan=1c|c0=c0" -map 0:2 -filter:a:1 "pan=1c|c0=c0" -map [vOut] -c:v prores_ks -r 25 -pix_fmt yuv422p10le -profile:v 1 -field_order progressive -y -strict -2 "/Users/kf/Desktop/testfile_working.mov”

This one creates the file sort of correct. The only difference is, when I open it in Quicktime player, only the first audio track is enabled.
ffmpeg -t 1 -i "/Volumes/Storage/_MoveToBackup/formatSamples/1x16-chAudioTest.mov" -filter_complex "[0:0]copy,fps=25,setfield=prog,setdar=dar=16/9,setsar=sar=1/1[vOut];[0:1]pan=1|c0=c0[a1];[0:2]pan=1|c0=c0[a2];[a1]amerge=inputs=1[aOut0];[a2]amerge=inputs=1[aOut1]" -c:a pcm_s24le -map [aOut0] -map [aOut1] -map [vOut] -c:v prores_ks -r 25 -pix_fmt yuv422p10le -profile:v 1 -field_order progressive -y -strict -2 "/Users/kf/Desktop/testfile.mov”

In this example there’s no problem using the first command.

But what if I had a file with 4 mono tracks, and I wanted to merge those 4 tracks into 2 stereo tracks. It does do what I’m asking it to, but again, only the first audio track is enabled.

ffmpeg -t 1 -i "/Volumes/Storage/_MoveToBackup/formatSamples/1x16-chAudioTest.mov" -filter_complex "[0:0]copy,fps=25,setfield=prog,setdar=dar=16/9,setsar=sar=1/1[vOut];[0:1]pan=1c|c0=c0[a1];[0:2]pan=1c|c0=c0[a2];[0:3]pan=1c|c0=c0[a3];[0:4]pan=1c|c0=c0[a4];[a1][a2]amerge=inputs=2[aOut0];[a3][a4]amerge=inputs=2[aOut1]" -c:a pcm_s24le -map [aOut0] -map [aOut1] -map [vOut] -c:v prores_ks -r 25 -pix_fmt yuv422p10le -profile:v 1 -field_order progressive -y -strict -2 "/Users/kf/Desktop/testfile.mov"

Output #0, mov, to '/Users/kf/Desktop/testfile.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf58.12.100
    Stream #0:0: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s
    Metadata:
      encoder         : Lavc58.18.100 pcm_s24le
    Stream #0:1: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s
    Metadata:
      encoder         : Lavc58.18.100 pcm_s24le
    Stream #0:2: Video: prores (prores_ks) (apcs / 0x73637061), yuv422p10le(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.18.100 prores_ks

Do any of you an idea on how to solve this?
I’ve testet against the latest build. The output of FFMpeg is identical, and this seems to be the case on .mov, prores and h.264, and .mp4, h.264.


More information about the ffmpeg-user mailing list