[Ffmpeg-devel] [PATCH] fix error croping

Luca Abeni lucabe72
Wed Apr 4 09:44:25 CEST 2007


Hi Limin,

Limin Wang wrote:
[...]
>>>     dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + 
>>>     left_band;
>> This looks wrong (regarding the left_band) for a packed format. Is it 
>> really working for you?
>> For example, when using yuyv422 I have to skip 4 bytes for cropping 2 
>> pixels, no?
> What's your meaning? for yuyv422, the left_band must be divided by 4, 
> that's 4, 8, 16, 32, etc. The reason is the data is stored as:
> yuyv yuyv ..., so we can't cut them. Yes, it works for me.
What I mean is: if you use "-cropleft 4", ffmpeg will want to remove 4 
pixels on the left of the image. But in my understanding the code quoted 
above will remove the first 4 bytes, which are
yuyv
and are only 2 pixels, unless I am wrong... No?

[...]
> lmwang at lmwang_pc:~/open/h264/ffmpeg$ ./ffmpeg -y -s 352x288 -pix_fmt
> rgb24 -i /tmp/rgb.yuv -croptop 0 -cropleft 6 -vcodec h264
> /tmp/foreman_cif.h264
> FFmpeg version SVN-r8622, Copyright (c) 2000-2007 Fabrice Bellard, et al.
>   configuration: --enable-gpl --enable-x264 --enable-libfaac --enable-libfaad
>   libavutil version: 49.4.0
>   libavcodec version: 51.40.2
>   libavformat version: 51.11.0
>   built on Apr  4 2007 15:04:20, gcc: 4.1.2 20061115 (prerelease) (Debian
>   4.1.1-21)
> Input #0, rawvideo, from '/tmp/rgb.yuv':
>   Duration: N/A, bitrate: N/A
>   Stream #0.0: Video: rawvideo, rgb24, 352x288, 25.00 fps(r)
> Output #0, h264, to '/tmp/foreman_cif.h264':
>   Stream #0.0: Video: h264, yuv420p, 346x288, q=2-31, 200 kb/s, 25.00 fps(c)
In this case, ffmpeg wants to remove 6 pixels, but it will remove 6 
bytes, which are
RGBRGB
only two pixels. Again, unless I missed something. In such case, I 
apologize.


				Luca




More information about the ffmpeg-devel mailing list