[FFmpeg-trac] #9266(ffprobe:open): ffprobe produces wrong output for compact format
FFmpeg
trac at avcodec.org
Sat Jul 17 02:00:27 EEST 2021
#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
More information about the FFmpeg-trac
mailing list