[Ffmpeg-devel] [PATCH] fix error croping

Baptiste Coudurier baptiste.coudurier
Tue Apr 3 11:45:38 CEST 2007


Hi

Limin Wang wrote:
> Hi,
> 
>>> $subj, please review it. If your input yuv is 422 packet format, then
>>> you'll failed to crop.
>> .. no attachment ..

AFAIR cropping on packed pixel format is not supported.

> 
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c	(revision 8565)
> +++ ffmpeg.c	(working copy)
> @@ -715,7 +715,7 @@
>          return;
>  
>      if (ost->video_crop) {
> -        if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, dec->pix_fmt, ost->topBand, ost->leftBand) < 0) {
> +        if (av_picture_crop((AVPicture *)&picture_crop_temp, (AVPicture *)in_picture, enc->pix_fmt, ost->topBand, ost->leftBand) < 0) {
>              av_log(NULL, AV_LOG_ERROR, "error cropping picture\n");
>              return;
>          }

in_picture is decoded picture, its pixel format is dec->pix_fmt not
enc->pix_fmt, and you must supply source pixel format to av_picture_crop.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312




More information about the ffmpeg-devel mailing list