[FFmpeg-devel] [RFC] Getting options from the file name

Michael Niedermayer michaelni at gmx.at
Thu Dec 29 16:51:12 CET 2011


On Thu, Dec 29, 2011 at 03:26:19PM +0100, Nicolas George wrote:
> Hi.
> 
> (This has come up before, but it was when the options system was just
> starting to exist.)
> 
> There are a few places in ffmpeg, and even more so in applications linked to
> FFmpeg libraries, where the user is expected to specify the URL of an input
> file. For example in lavfi:
> 
> ffmpeg -f lavfi -i 'amovie=some_file.wav, <filters>' ...
> 
> Unfortunately, these places do not usually allow to set options. For
> example, I can not write:
> 
> amovie=some_file.raw:f=s16le:channels=2:sample_rate=48000
> 
> It could be addressed in amovie: parsing options and passing them to
> avformat_open_input, but the same work would need to be done in each place
> an input file name is required, specially if the interface does not allow it
> easily (basic GUI file selector, text file containing filenames).
> 
> Let us be realistic: most of the time, it will not be done, and the user
> will be stuck.
> 
> I would like to avoid that.
> 
> My idea would be to use some syntax to encode options directly into the
> input URL. For example:
> 
> amovie=ffopt\:some_file.raw?f=s16le&channels=2&sample_rate=48000
> 
> The code to do that would be rather simple, I have a pretty good idea of how
> to do it. But I would like to see whether people approve of the idea, and
> see if they have interesting suggestions about the exact syntax.

ffplay -f lavfi -i 'movie=http\,Xuser-agentXJustTestingXX\\://samples.multimedia.cx/MPEG2/test422.m2v'
seems to work

the escaping needed by *movie is not the prettiest though but plain
http:// already needs the escaping ...

[...]

-- 
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: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111229/08aed5e7/attachment.asc>


More information about the ffmpeg-devel mailing list