Opened 5 years ago

Last modified 5 years ago

#7587 new defect

Writing timecode track even with -dn specified

Reported by: Steve Dierker Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Before this commit https://github.com/FFmpeg/FFmpeg/commit/4cfb01d6ae545cec4a507113a6cbcf3b6e727e94 we could encode MXF files containing a timecode track to MP4 with:

$ ffmpeg -i 0002PW.MXF -sn -dn -y test.mp4                                                                                                                                                                                                                                                          [13:43:43] 
ffmpeg version N-92603-g8440835dbe Copyright (c) 2000-2018 the FFmpeg developers                                                                                                                                                                                                                                              
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)                                                                                                                                                                                                                                                                             
  configuration: --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype --prefix=/home/steved/.local                                                                                                                                                     
  libavutil      56. 24.101 / 56. 24.101                                                                                                                                                                                                                                                                                      
  libavcodec     58. 41.100 / 58. 41.100                                                                                                                                                                                                                                                                                      
  libavformat    58. 23.102 / 58. 23.102                                                                                                                                                                                                                                                                                      
  libavdevice    58.  6.101 / 58.  6.101                                                                                                                                                                                                                                                                                      
  libavfilter     7. 46.101 /  7. 46.101                                                                                                                                                                                                                                                                                      
  libswscale      5.  4.100 /  5.  4.100                                                                                                                                                                                                                                                                                      
  libswresample   3.  4.100 /  3.  4.100                                                                                                                                                                                                                                                                                      
  libpostproc    55.  4.100 / 55.  4.100                                                                                                                                                                                                                                                                                      
[mxf @ 0x55661bcb5700] Stream #0: not enough frames to estimate rate; consider increasing probesize                                                                                                                                                                                                                           
Input #0, mxf, from '0002PW.MXF':                                                                                                                                                                                                                                                                                             
  Metadata:                                                                                                                                                                                                                                                                                                                   
    uid             : e87e72a4-97c4-4208-8e62-000687b92411                                                                                                                                                                                                                                                                    
    generation_uid  : 7981795e-eef6-45fc-b14c-9ff9fec012c7                                                                                                                                                                                                                                                                    
    company_name    : Panasonic                                                                                                                                                                                                                                                                                               
    product_name    : P2                                                                                                                                                                                                                                                                                                      
    product_version : 2.0                                                                                                                                                                                                                                                                                                     
    product_uid     : 060e2b34-0401-0109-0e0e-010101000001                                                                                                                                                                                                                                                                    
    modification_date: 2011-06-13T17:25:50.000000Z                                                                                                                                                                                                                                                                            
    material_package_umid: 0x060A2B340101010501010D4313000000F97687B3255705CB0080458234FA200B
    material_package_name: Gerd Conny0075
    timecode        : 03:06:20:10
  Duration: 00:00:37.76, start: 0.000000, bitrate: 113670 kb/s
    Stream #0:0: Video: h264 (High 4:2:2 Intra), yuv422p10le(pc, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      file_package_umid: 0x060A2B34010101050101064313000000F97687B3255705CC0080458234FA200B
    Stream #0:1: Data: none
    Metadata:
      file_package_umid: 0x060A2B34010101050101084313000000F97687B3255705CC0080458234FA200B
      data_type       : audio
    Stream #0:2: Data: none
    Metadata:
      file_package_umid: 0x060A2B34010101050101084313000000F97687B3255705CD0080458234FA200B
      data_type       : audio
    Stream #0:3: Data: none
    Metadata:
      file_package_umid: 0x060A2B34010101050101084313000000F97687B3255705CE0080458234FA200B
      data_type       : audio
    Stream #0:4: Data: none
    Metadata:
      file_package_umid: 0x060A2B34010101050101084313000000F97687B3255705CF0080458234FA200B
      data_type       : audio
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x55661bce1900] using SAR=1/1
[libx264 @ 0x55661bce1900] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55661bce1900] profile High 4:2:2, level 4.0, 4:2:2 8-bit
[libx264 @ 0x55661bce1900] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=24 lookahead_threads=4 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
Output #0, mp4, to 'test.mp4':
  Metadata:
    uid             : e87e72a4-97c4-4208-8e62-000687b92411
    generation_uid  : 7981795e-eef6-45fc-b14c-9ff9fec012c7
    company_name    : Panasonic
    product_name    : P2
    product_version : 2.0
    product_uid     : 060e2b34-0401-0109-0e0e-010101000001
    modification_date: 2011-06-13T17:25:50.000000Z
    material_package_umid: 0x060A2B340101010501010D4313000000F97687B3255705CB0080458234FA200B
    material_package_name: Gerd Conny0075
    timecode        : 03:06:20:10
    encoder         : Lavf58.23.102
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 0.04 fps, 12800 tbn, 25 tbc
    Metadata:
      file_package_umid: 0x060A2B34010101050101064313000000F97687B3255705CC0080458234FA200B
      encoder         : Lavc58.41.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame=  944 fps= 45 q=-1.0 Lsize=   95977kB time=00:00:37.64 bitrate=20888.5kbits/s speed= 1.8x
video:95964kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.013903%
[libx264 @ 0x55661bce1900] frame I:4     Avg QP:23.26  size:438237
[libx264 @ 0x55661bce1900] frame P:256   Avg QP:25.61  size:227949
[libx264 @ 0x55661bce1900] frame B:684   Avg QP:28.78  size: 55787
[libx264 @ 0x55661bce1900] consecutive B-frames:  3.4%  0.0%  0.0% 96.6%
[libx264 @ 0x55661bce1900] mb I  I16..4:  1.5% 92.6%  6.0%
[libx264 @ 0x55661bce1900] mb P  I16..4:  1.7% 17.6%  0.9%  P16..4: 37.3% 24.9% 16.5%  0.0%  0.0%    skip: 1.2%
[libx264 @ 0x55661bce1900] mb B  I16..4:  0.2%  1.4%  0.0%  B16..8: 37.3%  7.0%  2.4%  direct:17.8%  skip:33.9%  L0:41.4% L1:34.4% BI:24.2%
[libx264 @ 0x55661bce1900] 8x8 transform intra:87.1% inter:72.1%
[libx264 @ 0x55661bce1900] coded y,uvDC,uvAC intra: 76.5% 97.2% 71.4% inter: 37.8% 56.5% 11.7%
[libx264 @ 0x55661bce1900] i16 v,h,dc,p: 33% 38% 13% 16%
[libx264 @ 0x55661bce1900] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 19% 29%  4%  5%  5%  6%  5%  7%
[libx264 @ 0x55661bce1900] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 56% 10%  3%  3%  4%  5%  3%  5%
[libx264 @ 0x55661bce1900] i8c dc,h,v,p: 69% 12% 15%  4%
[libx264 @ 0x55661bce1900] Weighted P-Frames: Y:10.5% UV:5.1%
[libx264 @ 0x55661bce1900] ref P L0: 32.8% 11.4% 42.5% 12.1%  1.2%
[libx264 @ 0x55661bce1900] ref B L0: 72.2% 23.7%  4.1%
[libx264 @ 0x55661bce1900] ref B L1: 92.1%  7.9%
[libx264 @ 0x55661bce1900] kb/s:20819.12

Now this will also copy the timecode track resulting in a broken MP4:

$ ffprobe test.mp4                                                                                                                                                                                                                                                                                  [13:44:05]
ffprobe version N-92603-g8440835dbe Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)
  configuration: --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-version3 --enable-libfdk-aac --enable-libx264 --enable-libfreetype --prefix=/home/steved/.local
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 41.100 / 58. 41.100
  libavformat    58. 23.102 / 58. 23.102
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.23.102
  Duration: 00:00:37.76, start: 0.000000, bitrate: 20822 kb/s
    Stream #0:0(und): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 20819 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      timecode        : 03:06:20:10
    Stream #0:1(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      handler_name    : TimeCodeHandler
      timecode        : 03:06:20:10
Unsupported codec with id 0 for input stream 1

If we additionally specify -write_tmcd 0 it works again.
The source MXF can be found here: http://dl.flavoursys.com/samples/ffmpeg/ffmpeg_timecode.MXF

Change History (1)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: regression added
Priority: normalimportant
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.