[FFmpeg-devel] [PATCH] add ME_T/ESA to avcodec.h

Robert Swain robert.swain
Thu Jun 5 10:42:06 CEST 2008


2008/6/5 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Jun 04, 2008 at 11:55:23PM +0100, Robert Swain wrote:
>> On 4 Jun 2008, at 21:56, Baptiste Coudurier wrote:
>> > Michael Niedermayer wrote:
>> >> Me too, ive a half finished per codec defaults change locally ...
>> >
>> > Awesome !
>>
>> I made some patches for this that didn't quite work that used the
>> 'wrong' approach. Baptiste said they should use AVOption instead but I
>> was unaware of this API at the time and by the time I'd finished
>> writing it only to be told it would need rewriting, I didn't have the
>> motivation to fix it up. :)
>>
>> If you want to look at what I did, they are patches 0001-0004* here:
>>
>> http://www.swains.plus.com/superdump/ffmpeg/patches/
>>
>> I would appreciate if you made what you've done available too as I may
>> have some criticisms! :)
>
> Code below,
> just put -vpre anime-hq on the command line and have a file with the path
> ~/.ffmpeg/mpeg4-anime-hq.ffpreset
> with all your AVOptoion key=value stuff in it
> similar for other codecs.
>
> minor known bug, -vpre must be after -vcodec
>
> Iam planning to commit the code if there are no objections ...

This is presets code, not per codec defaults, but it's good. :)

Did you take a look at my patches for per codec defaults? Basically the idea is:

- Identify the chosen AVCodec before calling avcodec_get_context_defaults2()
- Add a AVCodec argument to avcodec_get_context_defaults2()
- Use this to look up the per codec defaults hardcoded in the codec
and apply them _at the end of_ avcodec_get_context_defaults2()

My suggestion is that each codec have its own defaults function with
AVCodecContext * argument (and any others necessary and available)
that assigns default values to AVCodecContext members. Baptiste and I
are looking into this at the moment. :)

Rob




More information about the ffmpeg-devel mailing list