phpvideotoolkit-v2
phpvideotoolkit-v2 copied to clipboard
Using cropdetect in ffmpeg
What would be fairly cool is a way to use cropdetect with ffmpeg. It would be nice that somehow this could be implemented as part of a workflow.
http://www.renevolution.com/understanding-ffmpeg-part-iii-cropping/
Below is an example of the console output when you add -vf cropdetect.
You run ffmpeg once outputting to a dummy file, only run a few seconds, then you have to run ffmpeg again with one of the supplied crop params ie crop=720:352:0:66 and bingo you get blackbars taken out.
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:336 t:5.605656 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:338 t:5.639023 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:340 t:5.672390 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:342 t:5.705757 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:344 t:5.739124 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:346 t:5.772491 crop=720:352:0:66
[Parsed_cropdetect_1 @ 0x21bc100] x1:0 x2:719 y1:60 y2:422 w:720 h:352 x:0 y:66 pts:348 t:5.805858 crop=720:352:0:66
Looks interesting, however I don't have the time at the moment to do that, but if you do a pull request I would happily merge it in.