[FFmpeg-trac] #9462(undetermined:new): Ffmpeg not removing unwanted metadata

FFmpeg trac at avcodec.org
Tue Oct 19 21:22:32 EEST 2021


#9462: Ffmpeg not removing unwanted metadata
-------------------------------------+-------------------------------------
             Reporter:  steipal      |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  METADATA     |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 FFmpeg don't seem to properly remove metadata even when specified.
 The attached file has metadata or side data like:
 {{{
 Mastering Display Metadata, has_primaries:1 has_luminance:1
 r(0.7080,0.2920) g(0.1700,0.7970) b(0.1310 0.0460) wp(0.3127, 0.3290)
 min_luminance=0.000000, max_luminance=9999.980500
 Content Light Level Metadata, MaxCLL=10000, MaxFALL=5656
 }}}

 This needs to be removed from the output.

 How to reproduce:
 {{{
 % ffmpeg -i sidedata.mp4 -vframes 1 -c:v libx264 -map_metadata -1 -vf
 sidedata=delete,metadata=delete -f null -
 }}}
 Full uncut console output:
 {{{
 ffmpeg version N-103405-g1930a85e83 Copyright (c) 2000-2021 the FFmpeg
 developers
   built with gcc 10.3.0 (Rev2, Built by MSYS2 project)
   configuration:  --disable-static --enable-shared --pkg-config=pkgconf
 --cc='ccache gcc' --cxx='ccache g++' --disable-autodetect --enable-amf
 --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-
 dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-
 sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-
 libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-
 libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-
 fontconfig --enable-libass --enable-libbluray --enable-libfreetype
 --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-
 libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr
 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-
 libvidstab --enable-libvo-amrwbenc --enable-libwebp --enable-libxml2
 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth
 --enable-libxvid --enable-libopenmpt --enable-version3 --enable-libsrt
 --enable-libgsm --enable-libvmaf --enable-libsvtav1 --enable-mbedtls
 --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-
 cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads
 --shlibdir=/local64/bin-video
   libavutil      57.  4.101 / 57.  4.101
   libavcodec     59.  6.100 / 59.  6.100
   libavformat    59.  4.102 / 59.  4.102
   libavdevice    59.  0.101 / 59.  0.101
   libavfilter     8.  4.100 /  8.  4.100
   libswscale      6.  0.100 /  6.  0.100
   libswresample   4.  0.100 /  4.  0.100
   libpostproc    56.  0.100 / 56.  0.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sidedata.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2mp41
     encoder         : Lavf59.4.102
   Duration: 00:00:00.04, start: 0.000000, bitrate: 2217 kb/s
   Stream #0:0[0x1](eng): Video: vp9 (Profile 2) (vp09 / 0x39307076),
 yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1600, 2049 kb/s, SAR 1:1
 DAR 12:5, 24.39 fps, 24.39 tbr, 16k tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
     Side data:
       Mastering Display Metadata, has_primaries:1 has_luminance:1
 r(0.7080,0.2920) g(0.1700,0.7970) b(0.1310 0.0460) wp(0.3127, 0.3290)
 min_luminance=0.000000, max_luminance=9999.980500
       Content Light Level Metadata, MaxCLL=10000, MaxFALL=5656
 Stream mapping:
   Stream #0:0 -> #0:0 (vp9 (native) -> h264 (libx264))
 Press [q] to stop, [?] for help
 [libx264 @ 000002b2666245c0] using SAR=1/1
 [libx264 @ 000002b2666245c0] using cpu capabilities: MMX2 SSE2Fast SSSE3
 SSE4.2
 [libx264 @ 000002b2666245c0] profile High 10, level 5.1, 4:2:0, 10-bit
 Output #0, null, to 'pipe:':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2mp41
     encoder         : Lavf59.4.102
   Stream #0:0(eng): Video: h264, yuv420p10le(tv,
 bt2020nc/bt2020/smpte2084, progressive), 3840x1600 [SAR 1:1 DAR 12:5],
 q=2-31, 24.39 fps, 24.39 tbn (default)
     Metadata:
       handler_name    : VideoHandler
       vendor_id       : [0][0][0][0]
       encoder         : Lavc59.6.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
       Mastering Display Metadata, has_primaries:1 has_luminance:1
 r(0.7080,0.2920) g(0.1700,0.7970) b(0.1310 0.0460) wp(0.3127, 0.3290)
 min_luminance=0.000000, max_luminance=9999.980500
       Content Light Level Metadata, MaxCLL=10000, MaxFALL=5656
 frame=    1 fps=0.0 q=40.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
 speed=0.195x
 video:5kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: unknown
 [libx264 @ 000002b2666245c0] frame I:1     Avg QP:21.80  size:  4755
 [libx264 @ 000002b2666245c0] mb I  I16..4: 91.1%  8.3%  0.6%
 [libx264 @ 000002b2666245c0] 8x8 transform intra:8.3%
 [libx264 @ 000002b2666245c0] coded y,uvDC,uvAC intra: 0.4% 0.0% 0.0%
 [libx264 @ 000002b2666245c0] i16 v,h,dc,p: 99%  0%  1%  0%
 [libx264 @ 000002b2666245c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 86%  4% 10%
 0%  0%  0%  0%  0%  0%
 [libx264 @ 000002b2666245c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 41% 19% 19%
 3%  3%  4%  3%  3%  3%
 [libx264 @ 000002b2666245c0] i8c dc,h,v,p: 100%  0%  0%  0%
 [libx264 @ 000002b2666245c0] kb/s:927.80
 }}}

 I would assume that "-map_metadata -1 -vf sidedata=delete,metadata=delete"
 would be enough to remove the unwanted metadata. If my assumptions are
 wrong I would appreciate instructions on how to remove the metadata.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9462>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list