[FFmpeg-devel] [PATCH 1/2] Add programs to ffprobe

Stefano Sabatini stefasab at gmail.com
Fri Jul 26 16:59:33 CEST 2013


On date Thursday 2013-07-25 12:55:40 +0200, Florent Tribouilloy encoded:
> Option -show_programs for ffprobe will sort the output by programs.
> 
> Signed-off-by: Florent Tribouilloy <florent.tribouilloy at smartjog.com>
> ---
>  doc/ffprobe.texi               |   14 ++++++--
>  doc/ffprobe.xsd                |   24 +++++++++++++
>  ffprobe.c                      |   76 +++++++++++++++++++++++++++++++++++-----
>  tests/ref/fate/ffprobe_compact |    2 +-
>  tests/ref/fate/ffprobe_csv     |    2 +-
>  tests/ref/fate/ffprobe_default |    1 +
>  tests/ref/fate/ffprobe_flat    |    1 +
>  tests/ref/fate/ffprobe_ini     |    1 +
>  tests/ref/fate/ffprobe_json    |    1 +
>  tests/ref/fate/ffprobe_xml     |    2 +-
>  10 files changed, 110 insertions(+), 14 deletions(-)

I tested the patch and was not very satisifed with the output, since I
liked to have an array with all the nested program streams, check
attachment (consider the JSON output in particular).

With this patch we have:
.A.      programs
...          program
..V              tags/program_tags
.A.              program_streams
...                  program_stream
...                      disposition/program_stream_disposition
..V                      tags/program_stream_tags


When the compact writer writes the program stream, it must know that
it needs to initiate it in a new line, this can be done telling it to
print a \n when the parent is an array and the grandparent already
contains other elements.

Check the patch in attachment, not very elegant, there is still the
problem that now the compact writer prints an empty line after the end
of the last program stream, since it closes the program section by
adding a newline.
-- 
FFmpeg = F***ing Foolish Magic Puristic Evil Gargoyle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ffprobe-add-show_programs-option.patch
Type: text/x-diff
Size: 21552 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130726/dfce289c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ffprobe-print-subsections-in-arrays-to-separate-line.patch
Type: text/x-diff
Size: 1890 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130726/dfce289c/attachment-0001.bin>


More information about the ffmpeg-devel mailing list