[FFmpeg-devel] [PATCH] ffprobe: add -show_headers_first option

Stefano Sabatini stefasab at gmail.com
Sun Sep 18 20:21:32 EEST 2016


On date Saturday 2016-09-10 13:51:34 +0200, Nicolas George encoded:
> Le tridi 23 fructidor, an CCXXIV, Stefano Sabatini a écrit :
[...]
> This issue of reading packets to extract information but not clutter the
> output with them is the reason I suggested in my example
> "packets+frames=silent=1".
> 
> Still, the inconsistent syntax does not bother me either way: I think users
> can understand that a feature (doing the probe but suppressing the output)
> only works for a particular section, but they can also understand that the
> same feature works for all sections but is only useful for one. Therefore,
> we do whichever is simpler to implement and just make sure to explain it in
> the doc.
> 
> There is another, more confusing case, where "print sections in order" can
> not work: packets and frames must be probed and printed together.
> 
> I think it would help to thinks of the steps not as sections to print but as
> tasks to perform. Most tasks are just printing a section, but the task about
> packets has three optional subtasks: printing the packets, decoding the
> frames, printing the frames (of course, printing the frames without decoding
> makes no sense).
> 
> If we design things to allow tasks to have aliases ("f" for "formats") and
> allow aliases to have different defaults for options, things can work in a
> way that is both convenient and logical. Consider a single task,
> "packets_and_frames", with three options, "print_packets=[01]",
> "decode_frames=[01]", "print_frames=[01]", and aliases: "packets" causing
> the options to default to 1/0/0, "frames" to 0/1/1; any other combination
> can be achieved by setting the options explicitly.
> 
> The enabling or disabling of individual fields can also be an option to
> tasks. That allow to support the same features as -show_entries in a more
> logical way.

So I thought more about this idea of a sort -dotasks option.

The problem with sorting the output of my proposed approach fights
with -read_packets. Indeed if we enable output ordering, still we
don't know when the program is supposed to read the packets (unless
we extend the syntax with something as !packets,format).

An hypotetical -dotasks option may solve the problem as this:
-dotasks format,packets=silent,streams

What if you want only to print some specific entries?

We can use it in combination with -show_entries, for example:
-dotasks packets=silent,streams,format -show_entries format=format_name

The problem with this approach is that it will conflict with
-show_entries, for example in:
-dotasks packets=silent,format -show_entries streams,packets

Unless you're suggesting to entirely dig the -show_entries
option. Otherwise we would need to figure out how to make the two
options coexist.
-- 
FFmpeg = Funny and Free Mortal Purposeless Easy Guru


More information about the ffmpeg-devel mailing list