Opened 7 years ago

Last modified 7 years ago

#6556 new defect

concat demuxer - Alternate Group, Default tags change

Reported by: Brendan Coates Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am trying to do some XDCAM concatenations and I'm getting some unexpected behavior. The concat demuxer is changing the Alternate Group and [Language] Default tags on one of the audio streams.

Please see linked files for complete example inputs, outputs, MediaInfo reports. Files can be found here:
https://archive.org/download/ffmpeg_bug-rep_20170728

Summary:

Input: two .movs, each with: 1 mpeg2 video stream, 2 mono pcm audio streams, 1 NDF timecode stream.

Output: 1 concatenated .mov, with: 1 video stream, 2 mono pcm audio streams, 1 fresh NDF timecode stream.

When put through MediaInfo (on the MediaConch site), the Alternate Group and Default tags of each input video are:
For Audio Stream 1:
<Default>Yes</Default>
<AlternateGroup>1</AlternateGroup>
For Audio Stream 2:
<Default>Yes</Default>
<AlternateGroup>2</AlternateGroup>

After running through the concat demuxer the Alternate Group and Default tags of the resulting output concat.mov are:
For Audio Stream 1:
<Default>Yes</Default>
<AlternateGroup>1</AlternateGroup>
For Audio Stream 2:
<Default>No</Default>
<AlternateGroup>1</AlternateGroup>

In practice, these tags hide audio streams from editing tools like Premiere, or you can only listen to 1 stream at a time in VLC (see image in link)

I have a work-around that stream copies the concatenated 2nd audio stream to a new mov, then re-wraps the video, audio stream 1, and the stream-copied audio stream 2 from the new mov, to a third mov. And that works ok for a dual-mono setup, however I also need to concatenate movs with more than 2 audio streams.

I would like to pass the input tag mapping for Alternate Group and [Language] Default from input to output unchanged.

Here is my concat.txt:

file 01962000.mov
file 01962001.mov

How to reproduce:

$ ffmpeg -f concat -safe 0 -i concat.txt -c copy -map 0 -timecode 00:00:00:00 -ignore_unknown concat.mov
ffmpeg version git-2017-07-28-8e275a7 Copyright (c) 2000-2017 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD-8e275a7 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libass --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-openssl --disable-lzma --enable-nonfree --enable-vda
  libavutil      55. 69.100 / 55. 69.100
  libavcodec     57.102.100 / 57.102.100
  libavformat    57. 76.100 / 57. 76.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 95.100 /  6. 95.100
  libavresample   3.  6.  0 /  3.  6.  0
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[concat @ 0x7f8efb800000] Could not find codec parameters for stream 3 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Input #0, concat, from 'concat.txt':
  Duration: N/A, start: 0.000000, bitrate: 52296 kb/s
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], 49992 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc
    Metadata:
      handler_name    : DataHandler
      encoder         : 1080i5994 50 Mbit 4:2:2 LG
      timecode        : 06:28:45:00
    Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      handler_name    : DataHandler
    Stream #0:3: Unknown: none
Cannot map stream #0:3 - unsupported type.
File 'concat.mov' already exists. Overwrite ? [y/N] y
Output #0, mov, to 'concat.mov':
  Metadata:
    timecode        : 00:00:00:00
    encoder         : Lavf57.76.100
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5b / 0x62356478), yuv422p(tv, top coded first (swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 49992 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc
    Metadata:
      handler_name    : DataHandler
      encoder         : 1080i5994 50 Mbit 4:2:2 LG
      timecode        : 06:28:45:00
    Stream #0:1(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      handler_name    : DataHandler
    Stream #0:2(eng): Audio: pcm_s24be (in24 / 0x34326E69), 48000 Hz, mono, s32 (24 bit), 1152 kb/s
    Metadata:
      handler_name    : DataHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47576, current: 23328; changing to 47577. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47576, current: 23328; changing to 47577. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47577, current: 24352; changing to 47578. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47577, current: 24352; changing to 47578. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47578, current: 25376; changing to 47579. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47578, current: 25376; changing to 47579. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47579, current: 26400; changing to 47580. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47579, current: 26400; changing to 47580. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47580, current: 27424; changing to 47581. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47580, current: 27424; changing to 47581. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47581, current: 28448; changing to 47582. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47581, current: 28448; changing to 47582. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47582, current: 28920; changing to 47583. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47582, current: 28920; changing to 47583. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47583, current: 29944; changing to 47584. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47583, current: 29944; changing to 47584. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47584, current: 30968; changing to 47585. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47584, current: 30968; changing to 47585. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47585, current: 31992; changing to 47586. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47585, current: 31992; changing to 47586. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47586, current: 33016; changing to 47587. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47586, current: 33016; changing to 47587. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47587, current: 34040; changing to 47588. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47587, current: 34040; changing to 47588. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47588, current: 35064; changing to 47589. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47588, current: 35064; changing to 47589. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47589, current: 36088; changing to 47590. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47589, current: 36088; changing to 47590. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47590, current: 37112; changing to 47591. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47590, current: 37112; changing to 47591. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47591, current: 38136; changing to 47592. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47591, current: 38136; changing to 47592. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47592, current: 39160; changing to 47593. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47592, current: 39160; changing to 47593. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47593, current: 40184; changing to 47594. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47593, current: 40184; changing to 47594. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47594, current: 41208; changing to 47595. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47594, current: 41208; changing to 47595. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47595, current: 42232; changing to 47596. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47595, current: 42232; changing to 47596. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47596, current: 43256; changing to 47597. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47596, current: 43256; changing to 47597. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47597, current: 44280; changing to 47598. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47597, current: 44280; changing to 47598. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47598, current: 45304; changing to 47599. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47598, current: 45304; changing to 47599. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47599, current: 46328; changing to 47600. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47599, current: 46328; changing to 47600. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:1; previous: 47600, current: 47352; changing to 47601. This may result in incorrect timestamps in the output file.
[mov @ 0x7f8efc000000] Non-monotonous DTS in output stream 0:2; previous: 47600, current: 47352; changing to 47601. This may result in incorrect timestamps in the output file.
frame=   66 fps=0.0 q=-1.0 Lsize=   14180kB time=00:00:02.09 bitrate=55468.4kbits/s speed=91.9x    
video:13439kB audio:737kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032131%

Change History (1)

comment:1 by dave rice, 7 years ago

Possibly related to https://github.com/FFmpeg/FFmpeg/commit/f90729699db9ede2bef2b28000f1795dab1b8996 but I'm not certain how to enable per_stream_grouping.

Note: See TracTickets for help on using tickets.