[FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

hjiodjf 97xgw46 jfbvxt at gmail.com
Wed Sep 10 20:45:48 CEST 2014


On Wed, Sep 10, 2014 at 11:26 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Wed, Sep 10, 2014 at 10:35:23AM -0700, hjiodjf 97xgw46 wrote:
>> It appears to work for me:
>
>
> ./ffmpeg -i matrixbench_mpeg2.mpg -vframes 5 -an -vf "cropdetect" -f null -
>
> before patch:
> [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:201 y2:437 w:624 h:224 x:94 y:208 pts:7200 t:0.080000 crop=624:224:94:208
> [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 y:198 pts:10800 t:0.120000 crop=624:240:94:198
> [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 y:198 pts:14400 t:0.160000 crop=624:240:94:198
> [Parsed_cropdetect_0 @ 0x27a46e0] x1:91 x2:719 y1:198 y2:437 w:624 h:240 x:94 y:198 pts:18000 t:0.200000 crop=624:240:94:198
>
> after patch:
> [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:201 y2:575 w:624 h:368 x:94 y:206 pts:7200 t:0.080000 crop=624:368:94:206
> [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 y:204 pts:10800 t:0.120000 crop=624:368:94:204
> [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 y:204 pts:14400 t:0.160000 crop=624:368:94:204
> [Parsed_cropdetect_0 @ 0x1e686e0] x1:91 x2:719 y1:198 y2:575 w:624 h:368 x:94 y:204 pts:18000 t:0.200000 crop=624:368:94:204
>
>
>
> [...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Good people do not need laws to tell them to act responsibly, while bad
> people will find a way around the laws. -- Plato
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Sorry about that. That was a brainfart on my end. I will leave the
s->[x1,x2,y1,y2] parameters as they are and just change the reporting
of w/h/x/y. Amended patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-returning-negative-rectangles-from-cropdetect.patch
Type: application/octet-stream
Size: 1332 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140910/c02a7ef8/attachment.obj>


More information about the ffmpeg-devel mailing list