[MPlayer-dev-eng] [PATCH] automatic cropping in vf_crop

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Jun 18 20:47:54 CEST 2007


On Monday 18 June 2007, Alexander Stege wrote:
> Hello everyone!
>
> This is a patch that merges the functionalities of the cropdetect and the
> crop video filter to enable automatic/interactive cropping of black borders
> without having to manually copy&paste and restart mplayer.
>
> To apply the crop parameters that cropdetect has detected, I have connected
> the filter to the 'change_rectangle' input.conf directive that belongs to
> the rectangle filter. rectangle is just a dummy-crop anyway I guess.
>
> cropdetect is only run on every 50th frame, so no worries about CPU-eating.

I once tried implementing something like this, but in a different way. Here it 
is. It's not meant to be included in svn, but I hope some parts of it can be 
used.

It allows to interactively change autocrop level and see results with a 
rectangle filter. There is a separate command to apply them.

A few filter controls are added:
VFCTRL_SET_RECTANGLE, VFCTRL_DISPLAY_RECTANGLE - vf_cropdetect sends them to 
vf_rectangle to display current crop settings.
VFCTRL_CROPDETECT_LEVEL - change the level parameter of cropdetect filter, 
generated by MP_CMD_CROPDETECT_LEVEL.
VFCTRL_CROP - change cropping coordinates, sent from vf_cropdetect to vf_crop.
VFCTRL_AUTOCROP - apply current crop settings. Generated by MP_CMD_AUTOCROP.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: autocrop.patch
Type: text/x-diff
Size: 12593 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070618/39e26af4/attachment.patch>


More information about the MPlayer-dev-eng mailing list