[FFmpeg-devel] [PATCH] ffprobe integration

Måns Rullgård mans
Tue Feb 9 13:11:35 CET 2010

Nicolas George <nicolas.george at normalesup.org> writes:

> Le primidi 21 pluvi?se, an CCXVIII, M?ns Rullg?rd a ?crit?:
>> I don't like that format.  It's hard to parse.  If you don't have
>> nested sections, there is no need for a closing marker at all.
> Having a closing marker makes it easier to parse, since it does not require
> a special case for the end of file.

I don't know how you write parsers, but the way I'd do it doesn't
require any special cases.  No matter how you do it, you obviously
must do _something_ at end of file.  Also, if you do require a closing
token, and the file ends without one, what will you do?

> On the other hand, I do not like the current format either, because [ and ]
> are active characters for the shell and for regular expressions. I would
> find something like that much more practical:
>   codec_type=video
>   stream_index=0
>   ...
> An empty line instead of END_PACKET, if it's guaranteed to be there and only
> there, is fine too.

It is a bad idea to have the closing marker depend on the
group/section name since it allows for malformed content which then
must be detected and rejected.  A generic "close whatever was last
opened" token avoids this problem.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list