user2920456
user2920456

Reputation: 209

Extract PRORES Video with 5.1 audio from file with Mono and downmix

I am trying to extract a prores video with just 5.1 audio from a Prores with the below audio track layout. How can I do that using the FFmpeg library?

I could not figure out which command to use from the below ffmpeg library spec https://trac.ffmpeg.org/wiki/AudioChannelManipulation#a2monostereo

Desired Output PRORES to contain below track layout

Below is the source video/audio Track Layout

Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 171944 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 23976 tbn, 23976 tbc (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels (FL), s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels (FR), s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels (LFE), s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels (BL), s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels (BR), s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, downmix, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      creation_time   : 2019-05-21T01:26:51.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:8(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2020-03-17T19:58:52.000000Z
      handler_name    : Time Code Media Handler
      reel_name       :
      timecode        : 00:00:00:00

Upvotes: 0

Views: 292

Answers (1)

llogan
llogan

Reputation: 133743

Use the channelmap filter:

ffmpeg -i input.mov -filter_complex "[0:a:0]channelmap=channel_layout=FL[FL];[0:a:1]channelmap=channel_layout=FR[FR];[0:a:2]channelmap=channel_layout=FC[FC];[0:a:3]channelmap=channel_layout=LFE[LFE];[0:a:4]channelmap=channel_layout=BL[BL];[0:a:5]channelmap=channel_layout=BR[BR]" -map 0:v -map "[FL]" -map "[FR]" -map "[FC]" -map "[LFE]" -map "[BL]" -map "[BR]" -map d -c copy -c:a pcm_s24le output.mov

Upvotes: 1

Related Questions