[FFmpeg-devel] RFC: -h message to stdout
Nicolas George
nicolas.george
Mon May 7 21:40:50 CEST 2007
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".
2. The quick and dirty: dup2(2, 1).
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.
Another question: while "ffmpeg -h" should certainly write to stdout, the
same is not true for "ffmpeg" alone. Does it matter?
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070507/229aabb5/attachment.pgp>
More information about the ffmpeg-devel
mailing list