[FFmpeg-trac] #11187(ffprobe:new): ffprobe -show_entries displays extra data (empty sub-blocks)

FFmpeg trac at avcodec.org
Thu Sep 12 11:10:25 EEST 2024


#11187: ffprobe -show_entries displays extra data (empty sub-blocks)
---------------------------------+----------------------------------
             Reporter:  qtmax    |                     Type:  defect
               Status:  new      |                 Priority:  normal
            Component:  ffprobe  |                  Version:  7.0
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
---------------------------------+----------------------------------
 **Description and steps to reproduce:**

 I use the following command to get video resolution:
 {{{
 $ ffprobe -v error -select_streams v:0 -show_entries stream=width,height
 -of csv=s=x:p=0 test.mp4
 1080x1920
 }}}

 However, for some files {{{1080x1920x}}} is printed. It happens when the
 {{{[STREAM]}}} entity contains a {{{[SIDE_DATA]}}} sub-entity:

 {{{
 $ ffprobe -v error -select_streams v:0 -show_entries stream test.mp4
 [STREAM]
 index=0
 codec_name=vp9
 codec_long_name=Google VP9
 profile=Profile 0
 codec_type=video
 codec_tag_string=vp09
 codec_tag=0x39307076
 width=1080
 height=1920
 <...>
 [SIDE_DATA]
 side_data_type=Ambient viewing environment
 ambient_illuminance=3140000/10000
 ambient_light_x=15635/50000
 ambient_light_y=16450/50000
 [/SIDE_DATA]
 [/STREAM]
 }}}

 When only width and height are requested, it still prints the empty
 {{{[SIDE_DATA]}}} block:

 {{{
 $ ffprobe -v error -select_streams v:0 -show_entries stream=width,height
 test.mp4
 [STREAM]
 width=1080
 height=1920
 [SIDE_DATA]
 [/SIDE_DATA]
 [/STREAM]
 }}}

 It apparently leads to printing the last empty field when using {{{-of
 csv}}}, which results in {{{1080x1920x}}} with {{{-of csv=s=x:p=0}}}.

 **Expected result:**

 As side_data hasn't been requested, it should not be printed as an empty
 block with the default format, and it should not add an extra empty field
 with the CSV format.

 Version info (package from Arch Linux):
 {{{
 ffmpeg version n7.0.2 Copyright (c) 2000-2024 the FFmpeg developers
   built with gcc 14.2.1 (GCC) 20240805
   configuration: --prefix=/usr --disable-debug --disable-static --disable-
 stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto
 --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-
 gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray
 --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav
 --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-
 libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack
 --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-
 libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg
 --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse
 --enable-librav1e --enable-librsvg --enable-librubberband --enable-
 libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-
 libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-
 libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-
 libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb
 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec
 --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-
 vapoursynth --enable-version3 --enable-vulkan
   libavutil      59.  8.100 / 59.  8.100
   libavcodec     61.  3.100 / 61.  3.100
   libavformat    61.  1.100 / 61.  1.100
   libavdevice    61.  1.100 / 61.  1.100
   libavfilter    10.  1.100 / 10.  1.100
   libswscale      8.  1.100 /  8.  1.100
   libswresample   5.  1.100 /  5.  1.100
   libpostproc    58.  1.100 / 58.  1.100
 }}}
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11187>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list