[Ffmpeg-devel] [PATCH] access all bitrates for amr nb encoding

Benoit Fouet benoit.fouet
Fri Feb 23 10:37:46 CET 2007


Hi,

Benoit Fouet wrote:
> Hi,
>
> Michael Niedermayer wrote:
>   
>> Hi
>>
>> On Thu, Feb 22, 2007 at 05:53:37PM +0100, Benoit Fouet wrote:
>>   
>>     
>>> Hi,
>>>
>>> Benoit Fouet wrote:
>>>
>>> [snip]
>>>     
>>>       
>>>>>>> then at appropriate places in the code the stuff from
>>>>>>> avctx_opts/avformat_opts is copied into the actual contexts
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>         
>>>>>>>             
>>>>>>>               
>>>>>> this is what i still have problems to see how is done...
>>>>>> and i guess i have to understand if i want to split it correctly (and do
>>>>>> things at their right places too)
>>>>>>     
>>>>>>       
>>>>>>           
>>>>>>             
>>>>> just grep for avctx_opts and replace it by avctx_opts[codec_type which looks
>>>>> appropriate]
>>>>>
>>>>>
>>>>>   
>>>>>     
>>>>>         
>>>>>           
>>>> i'm doing something like that at the moment... i'll get back when i get
>>>> all this working correctly (i mean, at least regression tests (which
>>>> have just finished successfully) and a bench of tests i have too)
>>>>
>>>>   
>>>>       
>>>>         
>>> well... i guess i missed something again...
>>> how can we know we have to fill only "audio / video / whatever" options
>>> in avctx_opts[codec_type] ?
>>> i mean, do i have to split opt_default function too ? or is there
>>> something i completely missed about default option management ?
>>>     
>>>       
>> my idea was:
>>
>>     for(i=0; i<CODEC_TYPE_NB; i++)
>>         o=av_set_string(avctx_opts[i], opt, arg);
>>     if(!o)
>>         o= av_set_string(avformat_opts, opt, arg);
>>     if(!o){
>>         if(opt[0] == 'a')
>>             o= av_set_string(avctx_opts[CODEC_TYPE_AUDIO], opt+1, arg);
>>         else if(opt[0] == 'v')
>>             o= av_set_string(avctx_opts[CODEC_TYPE_VIDEO], opt+1, arg);
>>     }
>>     if(!o)
>>         return -1;
>>
>> but i do not know if this will work ...
>>
>> [...]
>>   
>>   
>>     
> oh... ok !
> i was trying to come out with something more "general" (and failed to it
> at the moment...)
> i'll try that today...
>   
well... i don't think this can work...
i was thinking of the example of "b" and "ab" options for instance...
correct me if i'm wrong, but i think that using a command line with -ab
and then -b option will lead to override the first audio bitrate by the
second one...
if the options are set in the other way, though, this could work... but
i don't think you want to have an order in command line options :)
so... we still have our opt_default problem...
honestly, i can't see an easy way to "fix" it... maybe by splitting
opt_default() function, but not sure neither...
if someone has an idea, i'd be pleased to try it, though :)

Ben





More information about the ffmpeg-devel mailing list