[FFmpeg-devel] [PATCH 5/5] src_movie: implement multiple outputs.

Stefano Sabatini stefasab at gmail.com
Tue Jul 24 21:16:27 CEST 2012


On date Monday 2012-07-23 22:23:17 +0200, Nicolas George encoded:
> Le sextidi 6 thermidor, an CCXX, Stefano Sabatini a écrit :
> > Example? I believe this would require a movie option anyway, something
> > along the lines:
> > movie=in.avi:v=2:a=1:opts=...
> 
> I would like to be able to write:
> 
> movie=in.raw:f=rawvideo:video_size=pal:pixel_format=yuv420p:framerate=25

There is a namespace problem (which occurrs in ffmpeg as well).

Currently we have three different contexts where options can be
specified:
- the filter context
- the format context
- the stream contexts
- (potentially) the protocol context

If you have only format and stream, you can specify the context by
using a stream specifier: an option is looked in the format context
and *then* in the stream/codec context. If you want to force an option
on a codec, you set a stream specifier so that the option won't be
looked in the format context.

If you have two contexts which can't be distinguished this system
can't work (indeed there could be an option with the same name in the
filter and in the format context, and there is no way to force a
context), *unless* you define a way to specify the context of an
option.

So the above would become:
movie=in.raw:f=rawvideo:format/video_size=pal:codec/v1/pixel_format=yuv420p:format/framerate=25

Currently we have the following namespaces/contexts:

- filters (can be assumed to be the first context to be looked for, if
  the namespace is not specified)
- formats (just one format in case of the movie, so there is no
  ambiguity)
- streams/codecs: there are multiple of them, so the stream specifier
  is required for distinguishing between them
- protocols, bitstream filters, etc.: currently not implemented but
  it's not unlikely that we'll need to add options for them

In case the namespace is not specified, we can establish a pre-defined
look-up order (e.g.: filter, format, stream starting from the first
one).

It should be possible to extend the current API and use a notation
which allows to specify the namespace in the way I proposed (or the
equivalent which addresses the namespacing problem). This may be prove
to be useful also for the other components/tools.

An alternative (orthogonal) approach for simplifying the syntax would be to adopt
the notation used for filters/writers, e.g.
f='rawvideo=video_size=pal:framerate=25'
or
-f rawvideo=video_size=pal:framerate=25 
-- 
FFmpeg = Freak and Fierce Mind-dumbing Perennial Elitist Guru


More information about the ffmpeg-devel mailing list