Opened 11 years ago

Last modified 11 years ago

#3267 open defect

MP4 chapter metadata issues: weird/superfluous text streams

Reported by: y3kcjd5 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: mov chapters metadata
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

If I try to create an mp4 file with chapters in it and I do not include -map_metadata:c -1 in my command line, the resulting file will, for some bizarre reason, get a weird text stream tacked on to it invisibly. This stream doesn't show up anywhere in the creation log, and cannot be edited by ffmpeg in any way (trying to modify or add to its metadata has no effect). but a subsequent ffprobe will reveal its presence. My best guess is that this 'stream' contains the chapter metadata, but I am confounded as to why chapter metadata should show up in its own little fake stream while all other metadata is handled transparently. Example with metatst.mp4:

ffmpeg started on 2013-12-30 at 22:02:26
Report written to "ffmpeg-20131230-220226.log"
Command line:
ffmpeg -i metatst.mp4 -report -c copy metatst2.mp4
ffmpeg version N-59275-g9b195dd Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 21 2013 22:06:20 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.103 / 55. 45.103
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'metatst.mp4'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'metatst2.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file metatst.mp4.
Successfully parsed a group of options.
Opening an input file: metatst.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000357a60] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000357a60] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000357a60] Before avformat_find_stream_info() pos: 485573 bytes read:34864 seeks:1
[h264 @ 000000000035b4c0] Detected GBR colorspace.
[h264 @ 000000000035b4c0] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000357a60] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000357a60] After avformat_find_stream_info() pos: 7081 bytes read:67632 seeks:2 frames:2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'metatst.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.22.100
  Duration: 00:00:01.13, start: 0.094000, bitrate: 3446 kb/s
    Chapter #0.0: start 0.000000, end 0.500000
    Metadata:
      title           : 
    Chapter #0.1: start 0.500000, end 1.033000
    Metadata:
      title           : 
    Stream #0:0(und), 1, 1/24000: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), gbrp(tv, GBR), 1280x720 [SAR 1:1 DAR 16:9], 3030 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und), 1, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 410 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output file metatst2.mp4.
Applying option c (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: metatst2.mp4.
Successfully opened the file.
Output #0, mp4, to 'metatst2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.22.100
    Chapter #0.0: start 0.094000, end 0.594000
    Metadata:
      title           : 
    Chapter #0.1: start 0.594000, end 1.127000
    Metadata:
      title           : 
    Stream #0:0(und), 0, 1/24000: Video: h264 ([33][0][0][0] / 0x0021), gbrp, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 3030 kb/s, 23.98 fps, 24k tbn, 24k tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und), 0, 1/48000: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 410 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.
frame=   27 fps=0.0 q=-1.0 Lsize=     475kB time=00:00:01.10 bitrate=3505.7kbits/s    

video:417kB audio:56kB subtitle:0 global headers:0kB muxing overhead 0.557476%
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0000000002659ec0] Statistics: 86 seeks, 148 writeouts
[AVIOContext @ 0000000000358060] Statistics: 520389 bytes read, 2 seeks
ffprobe started on 2013-12-30 at 22:02:54
Report written to "ffprobe-20131230-220254.log"
Command line:
ffprobe metatst2.mp4 -report
ffprobe version N-59275-g9b195dd Copyright (c) 2007-2013 the FFmpeg developers
  built on Dec 21 2013 22:06:20 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 58.101 / 52. 58.101
  libavcodec     55. 45.103 / 55. 45.103
  libavformat    55. 22.100 / 55. 22.100
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.100 /  4.  0.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002fc680] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002fc680] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002fc680] Before avformat_find_stream_info() pos: 486124 bytes read:68179 seeks:3
[h264 @ 000000000030d620] Detected GBR colorspace.
[h264 @ 000000000030d620] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002fc680] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002fc680] After avformat_find_stream_info() pos: 7085 bytes read:100947 seeks:4 frames:2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'metatst2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.22.100
  Duration: 00:00:01.20, start: 0.000000, bitrate: 3230 kb/s
    Chapter #0.0: start 0.000000, end 0.594000
    Metadata:
      title           : 
    Chapter #0.1: start 0.594000, end 1.127000
    Metadata:
      title           : 
    Stream #0:0(und), 1, 1/24000: Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), gbrp(tv, GBR), 1280x720 [SAR 1:1 DAR 16:9], 3030 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und), 1, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 378 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng), 0, 1/1000: Subtitle: mov_text (text / 0x74786574), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
detected 2 logical cores
[AVIOContext @ 0000000000304ca0] Statistics: 100947 bytes read, 4 seeks

Note the third stream (index 2) that only shows up in the ffprobe report. Moreover, as previously mentioned, the only way to prevent this weirdostream from appearing is to include -map_metadata:c -1 (or -map_metadata -1) in the command line. This means that even if there is no actual chapter metadata, one such superfluostream is (aggravatingly) still generated by default (as demonstrated above).

Attachments (1)

metatst.mp4 (474.2 KB ) - added by y3kcjd5 11 years ago.
test file (that doesn't have a superfluostream, check it with ffprobe)

Download all attachments as: .zip

Change History (2)

by y3kcjd5, 11 years ago

Attachment: metatst.mp4 added

test file (that doesn't have a superfluostream, check it with ffprobe)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: mov added; mp4 removed
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Reproducible since at least version 0.6.

Note: See TracTickets for help on using tickets.