[Libav-user] How is cropping and scaling implemented

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Jan 31 22:59:07 CET 2015


Kristensen, Odd-Arild <okristensen at ...> writes:

> If filter_frame() does perform cropping, how does
> 
> frame->data[0] += s->y * frame->linesize[0];
> 
> frame->data[0] += s->x * s->max_step[0];
> 
> in any way change the pixels of the video?

I would say that cropping is not supposed to change 
the pixels (of a video).

> Scaling on the other hand seem to be done by 
> sws_scale() if I am not mistaken.

This is correct.

> But the wording in the documentation confuses me. 
> Does it change/convert the pixel format of the 
> video, or does it actually scale the video/frame 
> to a different resolution?

Both.

Carl Eugen



More information about the Libav-user mailing list