summaryrefslogtreecommitdiff
path: root/doc/filters.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/filters.texi')
-rw-r--r--doc/filters.texi57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 21a5bf5d5f..6e01df9fb5 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -13192,6 +13192,63 @@ PAL output (25i):
16p: 33333334
@end example
+@section threshold
+
+Apply threshold effect to video stream.
+
+This filter needs four video streams to perform thresholding.
+First stream is stream we are filtering.
+Second stream is holding threshold values, third stream is holding min values,
+and last, fourth stream is holding max values.
+
+The filter accepts the following option:
+
+@table @option
+@item planes
+Set which planes will be processed, unprocessed planes will be copied.
+By default value 0xf, all planes will be processed.
+@end table
+
+For example if first stream pixel's component value is less then threshold value
+of pixel component from 2nd threshold stream, third stream value will picked,
+otherwise fourth stream pixel component value will be picked.
+
+Using color source filter one can perform various types of thresholding:
+
+@subsection Examples
+
+@itemize
+@item
+Binary threshold, using gray color as threshold:
+@example
+ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
+@end example
+
+@item
+Inverted binary threshold, using gray color as threshold:
+@example
+ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
+@end example
+
+@item
+Truncate binary threshold, using gray color as threshold:
+@example
+ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
+@end example
+
+@item
+Threshold to zero, using gray color as threshold:
+@example
+ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
+@end example
+
+@item
+Inverted threshold to zero, using gray color as threshold:
+@example
+ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
+@end example
+@end itemize
+
@section thumbnail
Select the most representative frame in a given sequence of consecutive frames.