FFmpeg’s cropdetect can estimate the picture area in two different ways: black looks for surrounding pixels classified as black, while mvedges combines motion vectors with edge pixels. Treat either output as a crop candidate, not an instruction to apply a crop: choose a mode whose inputs fit the clip, then inspect whether the candidate keeps all meaningful picture content.
Choose a mode and read the options
Use black when the borders are expected to be consistently dark. Its limit controls the intensity threshold: values above the limit are treated as non-black. The default is 24; on 8-bit-based formats the documented range is 0–255, and a value from 0 to 1 can instead be scaled to the pixel format’s bit depth. If a border contains noise, a logo, or dark picture content, test how threshold choices affect the candidate rather than assuming a high threshold removes more picture safely.
Use mvedges when black-value detection is unsuitable and motion-vector data can be supplied. The documented examples generate vectors with mestimate before cropdetect, or export decoder vectors with -flags2 +export_mvs. Mvedges also scans for edge pixels. Do not assume vectors are available just because the clip contains motion; identify which documented route is being used. The filter also exposes mv_threshold and Canny low and high thresholds, but changing them is not a substitute for checking the resulting area.
Apply the options in their own roles:
- Select the mode based on border appearance and vector availability.
- Set
skipto control how many initial frames are excluded from evaluation; the default is 2. It does not reset accumulated results. - Choose
roundfor output dimension divisibility. The default is 16;2requests even dimensions. FFmpeg documents automatic offset adjustment to center the video, so a changed size can also change the proposed offset. - Consider
reset_count(also namedreset) when a channel logo distorts the detected area. Its default, 0, never resets and returns the largest area encountered during playback. A nonzero value makes the filter reset the previously detected largest area after the specified frame count and begin detecting the current optimal area; do not infer undocumented exact per-segment counting behavior.
The official cropdetect reference defines these controls. Its examples show vector generation and metadata printing; use those as documented starting points, not proof that a particular clip will produce a usable crop.
Record and review candidates
The following is a hypothetical worksheet, not an FFmpeg result or a promised output. Record the actual dimensions and offsets printed for your clip. Compare the same interval and keep other settings consistent when evaluating a mode or option.
| Hypothetical observation | Settings or condition | Decision to record |
|---|---|---|
| Black candidate: 1920×800 | black, limit=24, round=16, skip=2 | Inspect top and bottom throughout the interval; accept only if no active image is removed. |
| Dark detail appears in a border | Compare candidates at limit=16 and limit=32 | Note whether the candidate changes and whether the dark detail belongs to the picture; neither threshold is presumed correct. |
| Logo affects one segment | Compare reset_count=0 with a chosen nonzero reset setting | Record each printed candidate and the segment reviewed; do not assume a reset guarantees a logo-free result. |
| Vector-based candidate: 1920×816 | mvedges, vectors supplied via mestimate, round=2 | Check all four edges and confirm that the vector source and candidate correspond to the intended video area. |
For each candidate, step through frames at the beginning, middle, and end of the interval, plus any scene or logo transition. Check faces, captions, subtitles, embedded graphics, and other edge-adjacent content. A candidate passes only if the intended picture remains intact across the reviewed interval and its dimensions meet the delivery constraint. Record mode, vector source if applicable, limit, round, skip, reset setting, printed dimensions, and the visual review result.
Limits and next steps
A dark border is not proof that every dark pixel is disposable: picture content can extend into it. Conversely, an on-screen logo can affect the largest detected area. If black yields inconsistent candidates, inspect the frames and compare threshold settings; if that does not support a defensible crop, do not apply it automatically. If mvedges lacks usable vectors or returns a candidate that cuts into content, verify the vector-generation route and review edge pixels, then compare a different documented setup or define the crop manually in the downstream workflow.
round constrains divisibility; it does not establish that a crop is visually correct. skip excludes initial frames, while reset behavior addresses accumulated largest-area detection; these options do not serve interchangeable purposes. This guide explains the official filter documentation and offers a hypothetical review method. No FFmpeg run is claimed, and no candidate dimensions here are empirical.
Common questions
Does `limit=24` mean 24 percent black?
No. The documented default is an intensity threshold of 24 for 8-bit-based formats. Values above the threshold count as non-black. A 0–1 value is an alternative scaled by pixel-format bit depth.
Should I always use `round=2`?
No. It requests even dimensions, while the default 16 may suit many video codecs according to the documentation. Choose based on the downstream requirement, then inspect the resulting dimensions and offset.
Can I trust the largest area when a logo appears?
Not automatically. With reset disabled, the filter retains the largest area encountered during playback. Compare a reset setting when the logo distorts detection, and review the actual candidate against the picture before applying it.
Sources and next step
This guide interprets public documentation and uses explicitly hypothetical acceptance examples, not application tests. Controls and availability can change; verify the cited manual against your installed version.
For work created in Imagild, carry the input requirements and acceptance checklist into the film workspace. The external software controls discussed above belong to their respective products.