On date Friday 2009-10-16 15:39:29 -0500, [email protected] encoded:
> 
> I have some legacy code that was written against an old version of ffmpeg
> and I need to update it to use the latest API's.  There is some code that
> does cropping that currently looks like this:
> 
>             ImgReSampleContext* r_context = img_resample_full_init
> (dst_width, dst_height, src_linesize, src_height,
>                   crop.top, crop.bottom, crop.left, crop.right, 0, 0, 0,
> 0);
>             img_resample(r_context, (AVPicture*)&dst_picture,
> (AVPicture*)dst_frame);
>             img_resample_close(r_context);
> 
> where "crop" is just a struct containing the number of pixels to crop off
> on each of the four sides of the original image.  Looking over the ffmpeg
> release history, ImgReSampleContext and img_resample were deprecated and
> then removed, with the comment in the intermediate source code to "use
> sws_scale instead."  I have looked at sws_scale but don't see an easy way
> to do what the above code does -- seems like the "slice" parameters let you
> crop vertically, but not horizonatly.  Anyone know the answer to this?  Do
> I need to use libavfilter?

av_picture_crop() in libavcodec, but it works only with YUV formats,
check also the crop filter in the SOC libavfilter repo.

Regards.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to