[FFmpeg-devel] [PATCH 2/9] lavu/opt: introduce av_opt_serialize()

Stefano Sabatini stefasab at gmail.com
Tue Nov 11 13:49:51 CET 2014


On date Tuesday 2014-11-11 11:02:32 +0100, wm4 encoded:
> On Tue, 11 Nov 2014 08:31:24 +0100
> Lukasz Marek <lukasz.m.luki2 at gmail.com> wrote:
> 
> > TODO: bump minor version, update doc/APIchanges
> > 
> > Function allows to create string containing object's serialized options.
> > Such string may be passed back to av_set_options_string() in order to restore options.
> > 
> > Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
> > +Test av_opt_serialize()
> > +num=0,toggle=1,rational=1,string=default,flags=1,size=200x300,pix_fmt=297,sample_fmt=1,video_rate=25,duration=0.001000,color=0xffc0cbff,cl=311,bin=62696e00,bin1=,bin2=,num64=1,flt=0.3333333433,dbl=0.3333333333
> > +num=0,toggle=1,rational=1,string=default,flags=1,size=200x300,pix_fmt=297,sample_fmt=1,video_rate=25,duration=0.001000,color=0xffc0cbff,cl=311,bin=62696e00,bin1=,bin2=,num64=1,flt=0.3333333433,dbl=0.3333333333
> > +
> >  Testing av_set_options_string()
> >  OK    setting options string: ''
> >  Error setting options string: ':'
> 
[...]
> IMO it's quite WTFish to introduce such extensive functionality that
> is only going to be needed by a single broken thing (FFserver).

No I think this is useful on its own (I had a patch about that, in
attachment, it was part of a larger changeset:
 lavu/opt: make av_opt_get() return NULL in case a string is not set
 lavu/bprint: add av_bprint_options()
 lavc: add "s" and "pix_fmt" options to AVCodecContext
 doc: add section "Options lookup order"
 lavc: add sample_fmt option
 lavc/utils: shows context options

For example it is useful to print the configuration of an encoder, and
copy&paste its configuration from one application to another.
 
> Can't FFserver's design be fixed instead?

How do you suggest to fix it?
-- 
FFmpeg = Fundamentalist and Fiendish Mere Puritan Excellent Gadget
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavu-opt-make-av_opt_get-return-NULL-in-case-a-strin.patch
Type: text/x-diff
Size: 960 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141111/8322c65f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lavu-bprint-add-av_bprint_options.patch
Type: text/x-diff
Size: 4790 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141111/8322c65f/attachment-0001.bin>


More information about the ffmpeg-devel mailing list