Difference between revisions of "Documentation:Modules/crop"

From VideoLAN Wiki
Jump to navigation Jump to search
(Created page with " Crop video filter Remove borders of the video and replace them by black borders --crop-geometry=<string> Crop geometry (pixels) --autocrop, --no-autocrop Automat…")
 
m (Simplify range typo for transcluded pages)
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
Crop video filter
+
:''Were you looking for {{docmod|croppadd}}, the current module?''
Remove borders of the video and replace them by black borders
+
{{Module|name=Crop|type=Video filter|last_version=2.0.9|description=Remove borders of the video and replace them with black borders}}
      --crop-geometry=<string>   Crop geometry (pixels)
+
 
      --autocrop, --no-autocrop  Automatic cropping (default disabled)
+
== Options ==
      --autocrop-ratio-max=<integer [0 .. 15000]>
+
<onlyinclude>{{Option
                                Ratio max (x 1000)
+
|name=crop-geometry
      --crop-ratio=<integer [0 .. 15000]>
+
|value=string
                                Manual ratio
+
|description=Set the geometry of the zone to crop. This is set as <code><nowiki><width> &times; <height> + <left offset> + <top offset></nowiki></code>
      --autocrop-time=<integer>  Number of images for change
+
}}
      --autocrop-diff=<integer>  Number of lines for change
+
{{Option
      --autocrop-non-black-pixels=<integer>
+
|name=autocrop
                                Number of non black pixels
+
|value=boolean
      --autocrop-skip-percent=<integer [0 .. 100]>
+
|default=disabled
                                Skip percentage (%)
+
|description=Automatically detect black borders and crop them
      --autocrop-luminance-threshold=<integer [0 .. 128]>
+
}}
                                Luminance threshold
+
{{Option
Video scaling filter
+
|name=autocrop-ratio-max
  Crop:
+
|value=integer
      --croppadd-croptop=<integer [0 .. 2147483647]>
+
|default=2405
                                Pixels to crop from top
+
|min=0
      --croppadd-cropbottom=<integer [0 .. 2147483647]>
+
|max=15000
                                Pixels to crop from bottom
+
|description=Maximum image ratio. The crop plugin will never automatically crop to a higher ratio (ie, to a more "flat" image). The value is &times;1000: 1333 means 4&frasl;3
      --croppadd-cropleft=<integer [0 .. 2147483647]>
+
}}
                                Pixels to crop from left
+
{{Option
      --croppadd-cropright=<integer [0 .. 2147483647]>
+
|name=crop-ratio
                                Pixels to crop from right
+
|value=integer
  Padd:
+
|default=0
      --croppadd-paddtop=<integer [0 .. 2147483647]>
+
|min=0
                                Pixels to padd to top
+
|max=15000
      --croppadd-paddbottom=<integer [0 .. 2147483647]>
+
|description=Force a ratio (0 for automatic). Value is &times;1000: 1333 means 4&frasl;3
                                Pixels to padd to bottom
+
}}
      --croppadd-paddleft=<integer [0 .. 2147483647]>
+
{{Option
                                Pixels to padd to left
+
|name=autocrop-time
      --croppadd-paddright=<integer [0 .. 2147483647]>
+
|value=integer
                                Pixels to padd to right
+
|default=25
 +
|description=The number of consecutive images with the same detected ratio (different from the previously detected ratio) to consider that ratio changed and trigger recrop
 +
}}
 +
{{Option
 +
|name=autocrop-diff
 +
|value=integer
 +
|default=16
 +
|description=The minimum difference in the number of detected black lines to consider that ratio changed and trigger recrop
 +
}}
 +
{{Option
 +
|name=autocrop-non-black-pixels
 +
|value=integer
 +
|default=3
 +
|description=The maximum of non-black pixels in a line to consider that the line is black
 +
}}
 +
{{Option
 +
|name=autocrop-skip-percent
 +
|value=integer
 +
|default=17
 +
|min=0
 +
|max=100
 +
|description=Percentage of the line to consider while checking for black lines. This allows skipping logos in black borders and crop them anyway
 +
}}
 +
{{Option
 +
|name=autocrop-luminance-threshold
 +
|value=integer
 +
|default=40
 +
|min=0
 +
|max=128
 +
|description=Maximum luminance to consider a pixel as black <noinclude>(0-255)[[#Note|*]]</noinclude><includeonly>(0-128)</includeonly>
 +
}}</onlyinclude>
 +
 
 +
== Note ==
 +
This must be a typo. Despite the [https://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_filter/crop.c;h=2584780d98bb8527f9aacf540721a4ed5b852833;hb=c638a67c52980404d2aa6f6851b455743a898820#l97 claim of a range of <code>0-255</code>] in the help text for the <code>--autocrop-luminance-threshold</code> option,  [https://git.videolan.org/?p=vlc.git;a=blob;f=modules/video_filter/crop.c;h=2584780d98bb8527f9aacf540721a4ed5b852833;hb=c638a67c52980404d2aa6f6851b455743a898820#l129 the call] to <code>[https://git.videolan.org/?p=vlc.git;a=blob;f=include/vlc_configuration.h;h=bdbb11026492436f7f7297e096a8c62f8e899b68;hb=c638a67c52980404d2aa6f6851b455743a898820#l344 add_integer_with_range]</code> would have limited this to effectively <code>0-128</code>.
 +
 
 +
== Source code ==
 +
* {{VLCSourceFile|p=vlc/vlc-2.0.git|modules/video_filter/crop.c}}
 +
 
 +
{{Documentation}}

Latest revision as of 06:52, 7 April 2019

Were you looking for croppadd, the current module?
Module: Crop
Type Video filter
First VLC version -
Last VLC version 2.0.9
Operating system(s) all
Description Remove borders of the video and replace them with black borders
Shortcut(s) -

Options

  • crop-geometry <string> : Set the geometry of the zone to crop. This is set as <width> × <height> + <left offset> + <top offset>
  • autocrop <boolean> : Automatically detect black borders and crop them default value: disabled
  • autocrop-ratio-max <integer [0 .. 15000]> : Maximum image ratio. The crop plugin will never automatically crop to a higher ratio (ie, to a more "flat" image). The value is ×1000: 1333 means 4⁄3 default value: 2405
  • crop-ratio <integer [0 .. 15000]> : Force a ratio (0 for automatic). Value is ×1000: 1333 means 4⁄3 default value: 0
  • autocrop-time <integer> : The number of consecutive images with the same detected ratio (different from the previously detected ratio) to consider that ratio changed and trigger recrop default value: 25
  • autocrop-diff <integer> : The minimum difference in the number of detected black lines to consider that ratio changed and trigger recrop default value: 16
  • autocrop-non-black-pixels <integer> : The maximum of non-black pixels in a line to consider that the line is black default value: 3
  • autocrop-skip-percent <integer [0 .. 100]> : Percentage of the line to consider while checking for black lines. This allows skipping logos in black borders and crop them anyway default value: 17
  • autocrop-luminance-threshold <integer [0 .. 128]> : Maximum luminance to consider a pixel as black (0-255)* default value: 40

Note

This must be a typo. Despite the claim of a range of 0-255 in the help text for the --autocrop-luminance-threshold option, the call to add_integer_with_range would have limited this to effectively 0-128.

Source code

This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.