[FFmpeg-devel] RFC: -h message to stdout

Michael Niedermayer michaelni
Mon May 7 23:07:12 CEST 2007


On Mon, May 07, 2007 at 09:40:50PM +0200, Nicolas George wrote:
> Hi.
> The help message given by "ffmpeg -h" goes partially to stdout and partially
> to stderr. More precisely, the part specific to ffmpeg goes to stdout, but
> the help coming from lavc goes through av_log to stderr. I would like to fix
> that, and I see several solutions:
> 1. The easiest: send everything to stderr. This is wrong: the help message
>    is the normal, expected output of "ffmpeg -h". Furthermore, not all
>    shells allow to pipe stderr to a pager as easily as "|& less".

not good

> 2. The quick and dirty: dup2(2, 1).

if it works on all supported systems (and has no serious issues) then
iam not against it

> 3. Write a log handler that writes to stdout instead of stderr, and install
>    it at the start of show_help.
> 4. Add a flag to av_log to write to stdout instead of stderr.
> The solution 3 is probably the best, but 4 can be of some help for the
> future. Furthermore, if I write a new log handler, maybe I could make it
> public, so it can be reused.

the question is also if there is any place in libav* where we should output
to stdout, i think not so a flag might not be that usefull
so i would tend to prefer 3 as ideal solution too

> Another question: while "ffmpeg -h" should certainly write to stdout, the
> same is not true for "ffmpeg" alone. Does it matter?

to me personally? :)
not at all

if it bothers you or anyone else iam not against a small and clean patch
which would fix it ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070507/22763573/attachment.pgp>

More information about the ffmpeg-devel mailing list