0

Is this a bug, or expected behaviour? When converting materials from PAL to NTSC I invoke atempo as follows:

-map 0:a:? -af atempo=24000/25025 ^
-c:a pcm_s24le

I use this in a windows batch file (hence the caret) as a catch-all for all files that need to be converted, not having to deal with how many audio channels might be present or in what order.

However, when my input was a broadcast MXF with 10channel mono audio (1 per stream) it introduced wild phasing between the tracks.

Merging the tracks into a single stream to be processed by atempo resulted in no phasing.

-filter_complex "[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6][0:a:7][0:a:8][0:a:9] amerge=inputs=10, atempo=24000/25025[FRC]" ^
-map "[FRC]" -c:a pcm_s24le

Is this expected behaviour? I can't see any documentation detailing the need to first use amerge before invoking atempo.

If indeed this step is necessary, is there a way to "wildcard" the amerge operation so that I don't have to manually enter all the audio channels, and then the "inputs="? This would allow me to make it more universal.

This is my first question on stack overflow, so please be gentle. I've come here to find so many answers to my FFMPEG questions in the past--but this seems to be an edge case I can't get much detail on.

Thanks!

EDIT:

This output using the wildcard produces phasing:

C:\Windows>ffmpeg -ss 00:05:13.0 -r 24000/1001 -i "\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov" -t 00:00:22.0 -map 0:v:0 -c:v mpeg2video -profile:v 0 -level:v 2 -b:v 50000k -minrate 50000k -maxrate 50000k -pix_fmt yuv422p -vtag xd5d -force_key_frames "expr:gte(t,n_forced*1)" -streamid 0:481 -streamid 1:129 -map 0:a:? -af atempo=24000/25025 -c:a pcm_s24le "R:\2_SERIES\%~n1_25to23976_works.%Container%" -y
ffmpeg version N-94566-gddd92ba2c6 Copyright (c) 2000-2019 the FFmpeg developers
      built with gcc 9.1.1 (GCC) 20190807
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
      libavutil      56. 33.100 / 56. 33.100
      libavcodec     58. 55.100 / 58. 55.100
      libavformat    58. 30.100 / 58. 30.100
      libavdevice    58.  9.100 / 58.  9.100
      libavfilter     7. 58.100 /  7. 58.100
      libswscale      5.  6.100 /  5.  6.100
      libswresample   3.  6.100 /  3.  6.100
      libpostproc    55.  6.100 / 55.  6.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 06ea4cc0] Could not find codec parameters for stream 12 (Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s): unknown codec
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Guessed Channel Layout for Input Stream #0.2 : mono
    Guessed Channel Layout for Input Stream #0.3 : mono
    Guessed Channel Layout for Input Stream #0.4 : mono
    Guessed Channel Layout for Input Stream #0.5 : mono
    Guessed Channel Layout for Input Stream #0.6 : mono
    Guessed Channel Layout for Input Stream #0.7 : mono
    Guessed Channel Layout for Input Stream #0.8 : mono
    Guessed Channel Layout for Input Stream #0.9 : mono
    Guessed Channel Layout for Input Stream #0.10 : mono
    Guessed Channel Layout for Input Stream #0.11 : mono
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov':
      Metadata:
        major_brand     : qt
        minor_version   : 537199360
        compatible_brands: qt
        creation_time   : 2021-06-22T17:39:50.000000Z
      Duration: 00:59:08.16, start: 0.000000, bitrate: 217983 kb/s
        Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 206438 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Video Media Handler
          encoder         : Apple ProRes 422 HQ
          timecode        : 00:59:59:00
        Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
        Metadata:
          rotate          : 0
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Time Code Media Handler
          reel_name       : untitled
          timecode        : 00:59:59:00
        Stream #0:2(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:3(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:4(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:5(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:6(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:7(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:8(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:9(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:10(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:11(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
        Stream #0:12(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Closed Caption Media Handler
    Stream mapping:
      Stream #0:0 -> #0:0 (prores (native) -> mpeg2video (native))
      Stream #0:2 -> #0:1 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:3 -> #0:2 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:4 -> #0:3 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:5 -> #0:4 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:6 -> #0:5 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:7 -> #0:6 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:8 -> #0:7 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:9 -> #0:8 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:10 -> #0:9 (pcm_s24le (native) -> pcm_s24le (native))
      Stream #0:11 -> #0:10 (pcm_s24le (native) -> pcm_s24le (native))
    Press [q] to stop, [?] for help
    [mpeg2video @ 06f8aa40] Automatically choosing VBV buffer size of 746 kbyte
    Output #0, mxf, to 'R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf':
      Metadata:
        major_brand     : qt
        minor_version   : 537199360
        compatible_brands: qt
        encoder         : Lavf58.30.100
        Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5d / 0x64356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Video Media Handler
          timecode        : 00:59:59:00
          encoder         : Lavc58.55.100 mpeg2video
        Side data:
          cpb: bitrate max/min/avg: 50000000/50000000/50000000 buffer size: 6111232 vbv_delay: 18446744073709551615
        Stream #0:1(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:2(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:3(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:4(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:5(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:6(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:7(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:8(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:9(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
        Stream #0:10(eng): Audio: pcm_s24le, 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
        Metadata:
          creation_time   : 2021-06-22T17:39:50.000000Z
          handler_name    : Apple Sound Media Handler
          encoder         : Lavc58.55.100 pcm_s24le
    frame=  527 fps= 52 q=2.0 Lsize=  166106kB time=00:00:22.00 bitrate=61851.7kbits/s speed=2.19x
    video:133971kB audio:30938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.726204%

This is the output that produces no phasing

C:\Windows>ffmpeg -ss 00:05:13.0 -r 24000/1001 -i "\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov" -t 00:00:22.0 -map 0:v:0 -c:v mpeg2video -profile:v 0 -level:v 2 -b:v 50000k -minrate 50000k -maxrate 50000k -pix_fmt yuv422p -vtag xd5d -force_key_frames "expr:gte(t,n_forced*1)" -streamid 0:481 -streamid 1:129 -filter_complex "[0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6][0:a:7][0:a:8][0:a:9] amerge=inputs=10, atempo=24000/25025[FRC]" -map "[FRC]" -c:a pcm_s24le "R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf" -y
ffmpeg version N-94566-gddd92ba2c6 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 064f5580] Could not find codec parameters for stream 12 (Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Guessed Channel Layout for Input Stream #0.7 : mono
Guessed Channel Layout for Input Stream #0.8 : mono
Guessed Channel Layout for Input Stream #0.9 : mono
Guessed Channel Layout for Input Stream #0.10 : mono
Guessed Channel Layout for Input Stream #0.11 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '\\bdfs11\array21\Eps101_1920x1080_20_51_DV_CC_25fps_20210622.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2021-06-22T17:39:50.000000Z
  Duration: 00:59:08.16, start: 0.000000, bitrate: 217983 kb/s
    Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt709, progressive), 1920x1080, 206438 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Video Media Handler
      encoder         : Apple ProRes 422 HQ
      timecode        : 00:59:59:00
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      rotate          : 0
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Time Code Media Handler
      reel_name       : untitled
      timecode        : 00:59:59:00
    Stream #0:2(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:3(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:4(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:5(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:6(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:7(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:8(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:9(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:10(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:11(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:12(eng): Subtitle: none (c708 / 0x38303763), 1920x1080, 21 kb/s (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Closed Caption Media Handler
Stream mapping:
  Stream #0:2 (pcm_s24le) -> amerge:in0 (graph 0)
  Stream #0:3 (pcm_s24le) -> amerge:in1 (graph 0)
  Stream #0:4 (pcm_s24le) -> amerge:in2 (graph 0)
  Stream #0:5 (pcm_s24le) -> amerge:in3 (graph 0)
  Stream #0:6 (pcm_s24le) -> amerge:in4 (graph 0)
  Stream #0:7 (pcm_s24le) -> amerge:in5 (graph 0)
  Stream #0:8 (pcm_s24le) -> amerge:in6 (graph 0)
  Stream #0:9 (pcm_s24le) -> amerge:in7 (graph 0)
  Stream #0:10 (pcm_s24le) -> amerge:in8 (graph 0)
  Stream #0:11 (pcm_s24le) -> amerge:in9 (graph 0)
  Stream #0:0 -> #0:0 (prores (native) -> mpeg2video (native))
  atempo (graph 0) -> Stream #0:1 (pcm_s24le)
Press [q] to stop, [?] for help
[Parsed_amerge_0 @ 06e18dc0] No channel layout for input 1
[Parsed_amerge_0 @ 06e18dc0] Input channel layouts overlap: output layout will be determined by the number of distinct input channels
[mpeg2video @ 06dea000] Automatically choosing VBV buffer size of 746 kbyte
Output #0, mxf, to 'R:\2_SERIES\Eps101_1920x1080_20_51_DV_CC_25fps_20210622_25to23976_works.mxf':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf58.30.100
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5d / 0x64356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 50000 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2021-06-22T17:39:50.000000Z
      handler_name    : Apple Video Media Handler
      timecode        : 00:59:59:00
      encoder         : Lavc58.55.100 mpeg2video
    Side data:
      cpb: bitrate max/min/avg: 50000000/50000000/50000000 buffer size: 6111232 vbv_delay: 18446744073709551615
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 10 channels (FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL), s32, 11520 kb/s (default)
    Metadata:
      encoder         : Lavc58.55.100 pcm_s24le
frame=  527 fps= 61 q=2.0 Lsize=  165571kB time=00:00:22.00 bitrate=61652.6kbits/s speed=2.56x
video:133971kB audio:30938kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.402084%

Let me know if you need more detail than what I've provided.

EDIT2:

This thread seems like it might hold the solution to my problem:

How do I use ffmpeg to merge all audio streams (in a video file) into one audio channel?

But I don't have enough reputation to respond there in the comments.

When adding the call to ffprobe in a batch file I can't seem to call %~1, %~n1 or %~fn1.

Batch file:

@echo off
SETLOCAL
SET "Container=mov"
:hugly
if "%~1" EQU "" goto mugly
SET "FFREPORT=file=%~n1%~x1.%container%.log:level=32"
ffmpeg -ss 00:10:13.0 -r 24000/1001 -i "%~1" -t 00:00:22.0 ^
-filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 "%~1" | wc -l),atempo=24000/24024[audio]" ^
-map [video] -c:v prores_ks ^
-profile:v 3 ^
-vendor apl0 ^
-pix_fmt yuv422p10le ^
-map [audio] -c:a pcm_s24le "G:\%~n1_25to23976_test44.%Container%" -y
shift
goto hugly
:mugly
PAUSE

FFMPEG output:

ffmpeg started on 2021-10-05 at 11:59:00
Report written to "29000_Giant Bear_Film - Candy Hansel [24].mp4.mov.log"
Log level: 32
Command line:
ffmpeg -ss 00:10:13.0 -r 24000/1001 -i "R:\\9_FESTIVALS\\2021\\Blood in the Snow 2021\\Trailers\\Shorts\\29000_Giant Bear_Film - Candy Hansel [24].mp4" -t 00:00:22.0 -filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=\$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R:\\9_FESTIVALS\\2021\\Blood" in the Snow "2021\\Trailers\\Shorts\\29000_Giant" Bear_Film - Candy Hansel "[24].mp4 | wc -l),atempo=24000/24024[audio]" -map "[video]" -c:v prores_ks -profile:v 3 -vendor apl0 -pix_fmt yuv422p10le -map "[audio]" -c:a pcm_s24le "G:\\29000_Giant Bear_Film - Candy Hansel [24]_25to23976_test44.mov" -y
ffmpeg version 2021-09-27-git-b786bc7433-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      57.  7.100 / 57.  7.100
  libavcodec     59.  9.101 / 59.  9.101
  libavformat    59.  5.100 / 59.  5.100
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8.  9.100 /  8.  9.100
  libswscale      6.  1.100 /  6.  1.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'R:\9_FESTIVALS\2021\Blood in the Snow 2021\Trailers\Shorts\29000_Giant Bear_Film - Candy Hansel [24].mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41isomavc1
    creation_time   : 2019-03-18T17:41:46.000000Z
  Duration: 00:12:00.64, start: 0.000000, bitrate: 2310 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x816, 2169 kb/s, 24 fps, 24 tbr, 24 tbn (default)
    Metadata:
      creation_time   : 2019-03-18T17:41:46.000000Z
      handler_name    : L-SMASH Video Handler
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 137 kb/s (default)
    Metadata:
      creation_time   : 2019-03-18T17:41:46.000000Z
      handler_name    : L-SMASH Audio Handler
      vendor_id       : [0][0][0][0]
[amerge @ 0000022701950940] [Eval @ 0000005b3f3fe4d0] Undefined constant or missing '(' in 'ffprobe-loglevelerror-select_streamsa-show_entriesstream=codec_type-ofcsv=p=0R'
[amerge @ 0000022701950940] Unable to parse option value "$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R"
[Parsed_amerge_2 @ 0000022701950840] No option name near '9_FESTIVALS2021Blood'
[AVFilterGraph @ 000002277ff3f700] Error initializing filter 'amerge' with args 'inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 R:9_FESTIVALS2021Blood'
Error initializing complex filters.
Invalid argument

EDIT 3

the following command line outside of a batch file returns the same errors:

ffmpeg -ss 00:10:13.0 -r 24000/1001 -i test.mp4 -t 00:00:22.0 -filter_complex "[0:v]scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2[video];[0:a]amerge=inputs=$(ffprobe -loglevel error -select_streams a -show_entries stream=codec_type -of csv=p=0 test.mp4 | wc -l),atempo=24000/24024[audio]" -map "[video]" -c:v prores_ks -profile:v 3 -vendor apl0 -pix_fmt yuv422p10le -map "[audio]" -c:a pcm_s24le "G:\%~n1_25to23976_test44.mov" -y

I'm going through the ffprobe commandline entry by entry but I'm uncertain what function the "| wc -l" is performing as the ffprobe manual doesn't have an entry for "wc".

It seems this is a counting function within linux. This is likely why my command is failing!

  • Hello llogan, I've tried as you suggested with ffmpeg version 2021-09-27-git-b786bc7433-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers and the phasing remains in method #1. – BrainNoWerk Sep 27 '21 at 17:49
  • @llogan I think a suggestion you made in another thread might be a fix for me, but I can't seem to integrate it into a batch file. Can you assist? – BrainNoWerk Oct 05 '21 at 18:03
  • Sorry, but I don't know anything about batch. Not a Windows user. – llogan Oct 05 '21 at 18:41
  • OK. Oddly I get the same error skipping the batch file and invoking the filename manually. I've added the command line above. – BrainNoWerk Oct 05 '21 at 20:31
  • You're trying to use Linux commands in Windows. Windows doesn't have `wc`. I don't know what the equivalent is if there is one. – llogan Oct 05 '21 at 21:52

0 Answers0