[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


 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

 There is more than one way to fix this:
 1) Close the parent section and start a new line, like:
 2) Nest the array (assumes element is printed)

 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:

 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