[FFmpeg-soc] avfilter: what data ought to be available for configuration?

vmrsss vmrsss at gmail.com
Sat May 17 22:15:10 CEST 2008


I am forwarding for general discussion a thread I started privately  
with Vitor. Please, read below.

Begin forwarded message:
> vmrsss wrote:
>> Hi Vitor,
>>    I am trying to access from config_input the SAR of the source  
>> picture as in:
>>> static int config_input(AVFilterLink *link)
>>> {
>>>    PadContext *pad = link->dst->priv;
>>>    int width = link->w;
>>>    int height = link->h;
>> ...
>>>      if ( pad->a > 0.0f ) {
>>>        float aspect = pad->a;
>>>        aspect *= (double)link->srcpic->pixel_aspect.num/link- 
>>> >srcpic->pixel_aspect.den;
>> ....
>> bad idea because link->srcpic == NULL at that stage of the filter  
>> chain. Do you know how to get that information there? (The reason I  
>> need it is that without the SAR, I can't really compute the final  
>> aspect in the padding filter.)
>
> The problem is that the way the pixel_aspect is handled in lavf, it is
> a field of each one of the pictures (I wonder what is the use of that,
> if you can't change dimensions on the fly, why would you need to  
> change
> the pixel aspect ratio?). So if possible you should do all the SAR
> handling in  start_frame().
>
> But I understand this design can be a problem (for fixed-aspect  
> padding
> for example). Maybe the pixel aspect should be handled the same way  
> the
> height and the width are? Do you mind forwarding this discussion to  
> the
> soc ML?
>
> -Vitor

I suppose that, as you can't change the frame size, by changing the  
PAR potentially at each frame you can change the display size on the  
fly? Not sure this is useful for ffmpeg. Anyway:

I can certainly see situations where the configuration of a filter  
depends on the PAR of the previous one. Eg if you pad to a specific  
ratio, then you frame size you the outstream will depend on the PAR of  
the instream. I am no mplayer expert, but I think they do pass the  
information at config time (indeed, they pass width, height, d_width  
and d_height, where PAR=d_width/d_height*height/width).

Perhaps my subject line is an overkill, but I think this raises the  
question of what additional information, if any, one ought to pass  
around at filters config time.

vmrsss



More information about the FFmpeg-soc mailing list