Opened 8 years ago

Closed 7 years ago

Last modified 7 months ago

#5492 closed defect (fixed)

mov TimeCodeHandler always copied to mp4

Reported by: Christian Ebert Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mov regression
Cc: blacktrash@gmx.net Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
The (QuickTime?) TimeCodeHandler is always copied to mp4, in spite of using -dn and/or -ignore_unknown, -ignore_chapters 1.

How to reproduce:

$ ffprobe -select_streams d -show_streams test.mov
ffprobe version N-79691-g66dd21d Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --enable-gpl --enable-nonfree --disable-ffserver --enable-shared --enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libxvid --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ccc_trailer1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2009-05-05 13:45:52
  Duration: 00:04:14.24, start: 0.000000, bitrate: 30339 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p(bt470bg/smpte170m/bt709), 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 25 tbn (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
      encoder         : DV - PAL
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2009-05-05 13:47:58
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
Unsupported codec with id 0 for input stream 2
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_tag_string=tmcd
codec_tag=0x64636d74
id=N/A
r_frame_rate=0/0
avg_frame_rate=25/1
time_base=1/25
start_pts=0
start_time=0.000000
duration_ts=6356
duration=254.240000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:creation_time=2009-05-05 13:47:58
TAG:language=eng
TAG:handler_name=Apple Alias Data Handler
TAG:timecode=00:00:00:00
[/STREAM]
$ ffmpeg -ignore_chapters 1 -ignore_unknown -i test.mov -dn test.mp4
ffmpeg version N-79691-g66dd21d Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --enable-gpl --enable-nonfree --disable-ffserver --enable-shared --enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libxvid --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../ccc_trailer1.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2009-05-05 13:45:52
  Duration: 00:04:14.24, start: 0.000000, bitrate: 30339 kb/s
    Stream #0:0(eng): Video: dvvideo (dvcp / 0x70637664), yuv420p(bt470bg/smpte170m/bt709), 720x576 [SAR 16:15 DAR 4:3], 28800 kb/s, SAR 59:54 DAR 295:216, 25 fps, 25 tbr, 25 tbn (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
      encoder         : DV - PAL
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2009-05-05 13:47:58
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
[libx264 @ 0x7fd58901b000] using SAR=59/54
[libx264 @ 0x7fd58901b000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fd58901b000] profile High, level 3.0
[libx264 @ 0x7fd58901b000] 264 - core 148 r2694 3b70645 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[mp4 @ 0x7fd589019e00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, mp4, to 'test.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf57.34.103
    Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 720x576 [SAR 59:54 DAR 295:216], q=2-31, 0.04 fps, 12800 tbn (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc57.38.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2009-05-05 13:45:52
      handler_name    : Apple Alias Data Handler
      encoder         : Lavc57.38.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 6356 fps= 95 q=-1.0 Lsize=   84200kB time=00:04:14.25 bitrate=2712.9kbits/s speed= 3.8x
video:79997kB audio:4012kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.226182%
[libx264 @ 0x7fd58901b000] frame I:51    Avg QP:22.94  size: 52446
[libx264 @ 0x7fd58901b000] frame P:1698  Avg QP:25.02  size: 24179
[libx264 @ 0x7fd58901b000] frame B:4607  Avg QP:27.81  size:  8289
[libx264 @ 0x7fd58901b000] consecutive B-frames:  2.9%  0.8%  1.6% 94.7%
[libx264 @ 0x7fd58901b000] mb I  I16..4:  7.1% 80.0% 13.0%
[libx264 @ 0x7fd58901b000] mb P  I16..4:  2.3% 14.9%  4.9%  P16..4: 32.6% 15.9% 11.2%  0.0%  0.0%    skip:18.2%
[libx264 @ 0x7fd58901b000] mb B  I16..4:  0.5%  1.4%  0.9%  B16..8: 33.7%  7.3%  2.6%  direct: 6.6%  skip:46.9%  L0:40.1% L1:40.6% BI:19.3%
[libx264 @ 0x7fd58901b000] 8x8 transform intra:64.7% inter:69.4%
[libx264 @ 0x7fd58901b000] coded y,uvDC,uvAC intra: 80.1% 65.8% 15.8% inter: 24.3% 18.6% 0.8%
[libx264 @ 0x7fd58901b000] i16 v,h,dc,p: 11% 75%  5%  8%
[libx264 @ 0x7fd58901b000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 13% 28% 26%  4%  4%  5%  6%  5%  9%
[libx264 @ 0x7fd58901b000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  4% 76%  7%  2%  2%  2%  3%  1%  4%
[libx264 @ 0x7fd58901b000] i8c dc,h,v,p: 52% 29% 14%  4%
[libx264 @ 0x7fd58901b000] Weighted P-Frames: Y:13.2% UV:5.1%
[libx264 @ 0x7fd58901b000] ref P L0: 46.4% 16.3% 26.5%  9.8%  1.0%
[libx264 @ 0x7fd58901b000] ref B L0: 84.7% 12.2%  3.1%
[libx264 @ 0x7fd58901b000] ref B L1: 95.4%  4.6%
[libx264 @ 0x7fd58901b000] kb/s:2577.62
[aac @ 0x7fd58904bc00] Qavg: 473.940
$ ffprobe -select_streams d -show_streams test.mp4
ffprobe version N-79691-g66dd21d Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --enable-gpl --enable-nonfree --disable-ffserver --enable-shared --enable-openssl --enable-libspeex --enable-libopus --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libxvid --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libvidstab --extra-cflags=-I/sw/include --extra-libs=-L/sw/lib
  libavutil      55. 23.100 / 55. 23.100
  libavcodec     57. 38.100 / 57. 38.100
  libavformat    57. 34.103 / 57. 34.103
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 44.100 /  6. 44.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.34.103
  Duration: 00:04:14.26, start: 0.000000, bitrate: 2712 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x576 [SAR 59:54 DAR 295:216], 2577 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      timecode        : 00:00:00:00
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 00:00:00:00
Unsupported codec with id 0 for input stream 2
[STREAM]
index=2
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=data
codec_tag_string=tmcd
codec_tag=0x64636d74
id=N/A
r_frame_rate=0/0
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=3254272
duration=254.240000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=1
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:handler_name=TimeCodeHandler
TAG:timecode=00:00:00:00
[/STREAM]

As for my purpose the data stream is of no use I would expect -dn not to copy it.

Change History (9)

comment:1 by Carl Eugen Hoyos, 8 years ago

Component: ffmpegavformat
Keywords: data removed

comment:2 by Carl Eugen Hoyos, 8 years ago

Keywords: regression added

See also ticket #5414 - also related to b4dcd351

comment:3 by Tomer Lahav, 8 years ago

Worth noting that you cannot strip this tmcd stream even by explicitly using negative mapping:

ffmpeg
-ignore_chapters 1
-ignore_unknown
-i test.mov
-dn
-map -0:d
-map -0:2
-map -0:m:handler_name:TimeCodeHandler
test.mp4

No matter what stream specifier I try, the stream is being copied to output.
This is breaking our system, so if anyone has any workaround until it's fixed, would really appreciate it.

in reply to:  3 comment:4 by Carl Eugen Hoyos, 8 years ago

Replying to Melatonin64:

No matter what stream specifier I try, the stream is being copied to output.

This was requested in #4704, noone has explained why this is a bad idea.

This is breaking our system

Could you elaborate what is breaking or how?

so if anyone has any workaround until it's fixed, would really appreciate it.

You could simply undo the change introducing the issue.

comment:5 by Tomer Lahav, 8 years ago

Thanks for your quick reply.

We use fragmented MP4s for MSE playback on browsers that support it.
Seems like Safari on OSX does not like this timecode stream, it breaks MSE playback.

It might make sense to maintain the timecode data by default when muxing to MP4 (I'm not sure),
but I believe it's a bug that you cannot get rid of it.

in reply to:  5 comment:6 by Christian Ebert, 8 years ago

Replying to Melatonin64:

We use fragmented MP4s for MSE playback on browsers that support it.
Seems like Safari on OSX does not like this timecode stream, it breaks MSE playback.

It might make sense to maintain the timecode data by default when muxing to MP4 (I'm not sure),
but I believe it's a bug that you cannot get rid of it.

Or let -copy_unknown do the job which is now done by default, that's what the option is for, isn't it?
Maybe enable it for mov, but then obey -dn, but interface-wise this would still be confusing imho.

comment:7 by Juan Ibiapina, 7 years ago

We're also affected by this bug. We've tried everything but can't seem to get rid of that stream.

comment:8 by Carl Eugen Hoyos, 7 years ago

Resolution: fixed
Status: newclosed

You can use -write_tmcd 0 to disable writing the timecode since 46aae846165c35e6d184087542dd3e610fa36506

comment:9 by Martin, 7 months ago

I'am also affected by this problem.... And -write_tmcd 0 does not fix it. I wonder that the Status is changed to "closed"?

Last edited 7 months ago by Martin (previous) (diff)
Note: See TracTickets for help on using tickets.