[Libav-user] How is cropping and scaling implemented

Kristensen, Odd-Arild okristensen at albany.edu
Sun Feb 1 15:44:11 CET 2015

Fair point, cropping should not modify the pixels. But at some point you would want to remove the pixels outside the selected region, or copy the pixels inside the region to the destination frame. I dont’t see either of these things happening in filter_frame() Am I looking in the wrong place?
From: libav-user-bounces at ffmpeg.org <libav-user-bounces at ffmpeg.org> on behalf of Carl Eugen Hoyos <cehoyos at ag.or.at>
Sent: 31 January 2015 22:59
To: libav-user at ffmpeg.org
Subject: Re: [Libav-user] How is cropping and scaling implemented

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?


Carl Eugen

Libav-user mailing list
Libav-user at ffmpeg.org

More information about the Libav-user mailing list