[FFmpeg-devel] [PATCH] ffplay: fix and extend option -codec option

Stefano Sabatini stefasab at gmail.com
Thu Dec 13 11:56:11 CET 2012

On date Sunday 2012-12-09 20:03:03 +0100, Marton Balint encoded:
> On Sat, 8 Dec 2012, Stefano Sabatini wrote:
> >Allow to specify the stream for which the codec name is set. Also make
> >parsing and error reporting more robust.
> >---
> >doc/ffplay.texi |    6 ++++--
> >ffplay.c        |   50 ++++++++++++++++++++++++++++++++++++++++----------
> >2 files changed, 44 insertions(+), 12 deletions(-)
> >
> >diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> >index e2bded7..7923492 100644
> >--- a/doc/ffplay.texi
> >+++ b/doc/ffplay.texi
> >@@ -134,8 +134,10 @@ Exit when video is done playing.
> >Exit if any key is pressed.
> >@item -exitonmousedown
> >Exit if any mouse button is pressed.
> >- at item -codec:@var{stream_type}
> >-Force a specific decoder implementation
> >+
> >+ at item -codec:@var{stream_specifier} @var{codec_name}
> >+Force a specific decoder implementation for the stream specified by
> >+ at var{stream_specifier}.
> >@end table

Sorry, after more thinking I'm not really satisfied with the
patch. Indeed being able to set the codec for a generic stream is not
consistent with the general framework, which right now only allows to
set options for video/audio/subtitle stream.

I suggest the following solutions:

1. create the acodec/vcodec/scodec options, as an alias to
   codec:{a,v,s}, while keeping support to the old syntax

This is consistent with the general options, setting codec:v/a/s gives
the wrong impression that ffplay supports the more generic ffmpeg
syntax, which is not true, and creating a partial mapping is

2. allow to specify stream options through the syntax:

This would allow to overcome the limitation at point 1, but would be
inconsistent with the ffmpeg syntax.

I'll implement 1, while it would be useful to implement 2 at some
point, in order to support generic stream option setting (the change
could be propagate to the other tools and factorized).
FFmpeg = Fascinating and Funny Mournful Peaceful Elastic Goblin

More information about the ffmpeg-devel mailing list