#9266(ffprobe:new): ffprobe produces wrong output for compact format
#9266: ffprobe produces wrong output for compact format ---------------------------------+-------------------------------------- Reporter: maksut | Type: defect Status: new | Priority: normal Component: ffprobe | Version: git-master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ---------------------------------+-------------------------------------- ffprobe produces wrong output for compact format when: 1. stream has side data and 2. "-show_entries stream=codec_type" filter is applied. See "codec_type=videoside_data" below: {{{ ❯ ffprobe -v quiet -show_entries stream=codec_type -print_format compact rotate_test.mp4 stream|codec_type=videoside_data| stream|codec_type=audio }}} Valid json output for comparison: {{{ ❯ ffprobe -v quiet -show_entries stream=codec_type -print_format json rotate_test.mp4 { "programs": [ ], "streams": [ { "codec_type": "video", "side_data_list": [ { } ] }, { "codec_type": "audio" } ] } }}} Version 4.3.1 and git master has the problem. But version 4.0 '''does not''' have it. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: new Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Comment (by Carl Eugen Hoyos): Please understand that ticket with `-v quiet` are generally invalid and please attach an input file that allows to reproduce. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: new Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by maksut): * Attachment "A_monkey_tale_.3gp" added. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: new Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Description changed by maksut: Old description:
ffprobe produces wrong output for compact format when: 1. stream has side data and 2. "-show_entries stream=codec_type" filter is applied.
See "codec_type=videoside_data" below: {{{ ❯ ffprobe -v quiet -show_entries stream=codec_type -print_format compact rotate_test.mp4
stream|codec_type=videoside_data|
stream|codec_type=audio }}}
Valid json output for comparison: {{{ ❯ ffprobe -v quiet -show_entries stream=codec_type -print_format json rotate_test.mp4
{ "programs": [
], "streams": [ { "codec_type": "video", "side_data_list": [ {
} ] }, { "codec_type": "audio" } ] } }}}
Version 4.3.1 and git master has the problem. But version 4.0 '''does not''' have it.
New description: ffprobe produces wrong output for compact format when: 1. stream has side data and 2. "-show_entries stream=codec_type" filter is applied. See "codec_type=videoside_data" below: {{{ ❯ ffprobe -show_entries stream=codec_type -print_format compact A_monkey_tale_.3gp ffprobe version 4.4 Copyright (c) 2007-2021 the FFmpeg developers built with Apple clang version 12.0.0 (clang-1200.0.32.29) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host- cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable- libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable- videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 [amrnb @ 0x7fdc8780a600] Multiple frames in a packet. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'A_monkey_tale_.3gp': Metadata: major_brand : 3gp5 minor_version : 768 compatible_brands: 3gp53gp43g2aisom creation_time : 2009-10-27T08:36:15.000000Z Duration: 00:01:09.44, start: 0.000000, bitrate: 141 kb/s Stream #0:0(eng): Video: h263 (s263 / 0x33363273), yuv420p, 128x96 [SAR 12:11 DAR 16:11], 127 kb/s, 14.40 fps, 14.99 tbr, 15750 tbn, 29.97 tbc (default) Metadata: rotate : 0 creation_time : 2009-10-27T08:36:15.000000Z handler_name : vide vendor_id : [0][0][0][0] Side data: displaymatrix: rotation of -0.00 degrees Stream #0:1(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default) Metadata: rotate : 0 creation_time : 2009-10-27T08:36:15.000000Z handler_name : soun vendor_id : [0][0][0][0] stream|codec_type=videoside_data| stream|codec_type=audio }}} Valid json output for comparison: {{{ ❯ ffprobe -show_entries stream=codec_type -print_format json A_monkey_tale_.3gp ffprobe version 4.4 Copyright (c) 2007-2021 the FFmpeg developers built with Apple clang version 12.0.0 (clang-1200.0.32.29) configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host- cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable- libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable- videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 { [amrnb @ 0x7fc84a817800] Multiple frames in a packet. Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'A_monkey_tale_.3gp': Metadata: major_brand : 3gp5 minor_version : 768 compatible_brands: 3gp53gp43g2aisom creation_time : 2009-10-27T08:36:15.000000Z Duration: 00:01:09.44, start: 0.000000, bitrate: 141 kb/s Stream #0:0(eng): Video: h263 (s263 / 0x33363273), yuv420p, 128x96 [SAR 12:11 DAR 16:11], 127 kb/s, 14.40 fps, 14.99 tbr, 15750 tbn, 29.97 tbc (default) Metadata: rotate : 0 creation_time : 2009-10-27T08:36:15.000000Z handler_name : vide vendor_id : [0][0][0][0] Side data: displaymatrix: rotation of -0.00 degrees Stream #0:1(eng): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default) Metadata: rotate : 0 creation_time : 2009-10-27T08:36:15.000000Z handler_name : soun vendor_id : [0][0][0][0] "programs": [ ], "streams": [ { "codec_type": "video", "side_data_list": [ { } ] }, { "codec_type": "audio" } ] } }}} Version 4.3.1 and git master has the problem. But version 4.0 '''does not''' have it. -- -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: new Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Comment (by maksut): Carl Eugen Hoyos, I've updated the description with an example without "-v quiet" and also attached the sample video. Thanks! -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: open Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 1 | ------------------------------------+----------------------------------- Changes (by kev): * analyzed: 0 => 1 * cc: kev (added) * status: new => open Comment: I've encountered this issue before and made a local fix. This is a duplicate of #7153, and is a output formatting bug in the compact_writer Writer class implementation of print_section_header and print_section_footer (fftools/ffprobe.c) The issue occurs any time an array section is added inside of another section (e.g. STREAM_SIDE_DATA_LIST inside of STREAM). Arrays are not permitted to nest, so the new array section formats as if it already started a new line, and an extra new line is inserted when the enclosing section closes (because it expected no newlines were inserted by nested sections). There is more than one way to fix this: 1) Close the parent section and start a new line, like: {{{ stream|codec_type=video side_data| stream|codec_type=audio }}} 2) Nest the array (assumes element is printed) {{{ stream|codec_type=video|side_data:side_data_type=SOMETHING stream|codec_type=audio }}} Personally, I think it should be nested to reflect the data hierarchy, and nested arrays should have indexed elements. For example, the components array is indexed here: {{{ pixel_format|name=x2rgb10le|nb_components=3|log2_chroma_w=N/A|log2_chroma_h=N/A|bits_per_pixel=30|flags:big_endian=0|flags:palette=0|flags:bitstream=0|flags:hwaccel=0|flags:planar=0|flags:rgb=1|flags:alpha=0|components[0]:index=1|components[0]:bit_depth=10|components[1]:index=2|components[1]:bit_depth=10|components[2]:index=3|components[2]:bit_depth=10 pixel_format|name=x2rgb10be|nb_components=3|log2_chroma_w=N/A|log2_chroma_h=N/A|bits_per_pixel=30|flags:big_endian=1|flags:palette=0|flags:bitstream=0|flags:hwaccel=0|flags:planar=0|flags:rgb=1|flags:alpha=0|components[0]:index=1|components[0]:bit_depth=10|components[1]:index=2|components[1]:bit_depth=10|components[2]:index=3|components[2]:bit_depth=10 }}} If this looks like a good fix, I could submit a patch from my changes. -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: open Priority: normal | Component: ffprobe Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 1 | ------------------------------------+----------------------------------- Comment (by Stefano Sabatini):
Personally, I think it should be nested to reflect the data hierarchy, and nested arrays should have indexed elements. For example, the components array is indexed here:
Sorry for the super slow answer, I agree this should be nested. If you can provide a patch on ffmpeg-devel this would be ideal (I'll try to work a solution, but feel free to send your own solution if you have time). -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#9266: ffprobe produces wrong output for compact format ------------------------------------+----------------------------------- Reporter: maksut | Owner: (none) Type: defect | Status: closed Priority: normal | Component: ffprobe Version: git-master | Resolution: fixed Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 1 | ------------------------------------+----------------------------------- Changes (by Stefano Sabatini): * status: open => closed * resolution: => fixed Comment: Should be fixed in commit http://git.videolan.org/?p=ffmpeg.git;a=commit;h=d2d3a83ad932161a2c572416d7d.... -- Ticket URL: <https://trac.ffmpeg.org/ticket/9266#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg