This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

[BUG] Cropping doesn't work properly on latest version.
#1
Hi!

Win 11 26H2.
Latest version  2026.10.09.does not autodetect black bars for cropping at all and also latest experimental (2026.11.23.1) detects them wrong.

What to do to reproduce: 

1. load whatever video file that contains black bars
2. hit the auto crop button
3. result = black bars are either not detected properly or not at all

I can still set the values manually.

Please see attached images. 

Thank you.


Attached Files Thumbnail(s)
           
Reply
#2
Works fine here on

In your first screen shot the the right side is probably cropped too much tue to the luma value, depending on the characteristics of your source.
No clue for the second screenshot, my guess is that there is a frame where the full frame is active.

Can you share:
a. small clips that allow to reproduce the issue
b. a debug output of the crop analysis (first run not a later one, since that would take hit the cache)
if your sources black bars have a luma value > 24 you will need to adjust "Crop/Resize->Misc->Advanced Auto Crop Options"

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive. (alternative)
Reply
#3
Here's the debug output.

I tried 3 different files, either crop is not detected at all or is wrong.


Attached Files
.zip   HybridDebugOutput.zip (Size: 45,55 KB / Downloads: 8)
Reply
#4
Hybrid does call:
"C:\Program Files\Hybrid\64bit\ffmpeg.exe" -hide_banner -nostdin -skip_frame nokey -ss 580.893 -apply_cropping codec -i "E:\TEMP\Soylent Green (1973, Richard Fleischer) 1080p 1ch.mkv" -map 0:0 -an -sn -dn -vf cropdetect=24:2 -frames:v 12 -f null NUL
where "-vf cropdetect=24:2" means:
24 = max level detected as border
2 = adjust to modulo 2
the output is:
2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:2815 t:2.815000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 1/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:3774 t:3.774000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 2/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:4734 t:4.734000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 3/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:5735 t:5.735000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 4/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:6736 t:6.736000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 5/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:7695 t:7.695000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 6/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:8654 t:8.654000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 7/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:9614 t:9.614000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 8/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:10573 t:10.573000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 9/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:10781 t:10.781000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 10/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800. 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: CropDetection output: [Parsed_cropdetect_0 @ 00000164501d0300] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:11782 t:11.782000 limit:24.000000 crop=1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: Crop info: 1920:800:0:140 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: AutoCrop scanned 11/108 frames. (current section 1 of 9) 2026.11.24 - 18:54:24_Windows 11 Version 26H2 (64bit)_2026.11.23.1 - level 9: -> Current crop resolution 1920x800.
Hybrids parsing seems to be correct (assuming the right side values have a luma value <= 24).

My guess is that there is some issue with the analysis in ffmpeg.
(can't reproduce this here, analysed 25 samples here, which all worked fine)


Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive. (alternative)
Reply
#5
So I installed FFmpeg 9.1, pointed the program at that executable.

That didn't do anything.

Then I set "Threshold/mod/count" to "16/2/500" and "Sections to scan" to 14.

That fixed cropping for 2 of the 3 files. 

Guess I'll try playing with those values some more.
Or wait for a new version  Big Grin
Reply
#6
A new version will not change the default behavior.
The 24 is used as a default to account for content where tv and pc scale got mixed up. Smile
The advanced auto crop options are exactly for the case where the defaults do not work well for a source.

For example here is a source where the borders use luma 27 and thus crop threshold would need to be raised to 28.

Cu Selur

Ps: got an idea for an autothreshold option, but would need test samples for it.
----
Dev versions are in the 'experimental'-folder of my GoogleDrive. (alternative)
Reply
#7
It is ffmpeg !!

I've been reading a bit. I ran this:

PS E:\> ffmpeg -hide_banner -i .\sample1.mkv -vframes 20 -vf cropdetect -f null -

So I get 
PS E:\> ffmpeg -hide_banner -i .\sample1.mkv -vframes 20 -vf cropdetect -f null - Input #0, matroska,webm, from '.\sample1.mkv':   Metadata:     ENCODER         : Lavf63.1.102   Duration: 00:00:17.60, start: 0.042000, bitrate: 15328 kb/s   Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, start 0.042000     Metadata:       DURATION        : 00:00:17.601000000 [vost#0:0/wrapped_avframe @ 0000024a55cf6d80] Discarding stream metadata 'DURATION' because the stream is being re-encoded. Use '-keep_metadata DURATION' to keep it. Stream mapping:   Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native)) Press [q] to stop, [?] for help Output #0, null, to 'pipe:':   Metadata:     encoder         : Lavf63.16.100   Stream #0:0: Video: wrapped_avframe, yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn     Metadata:       encoder         : Lavc63.24.100 wrapped_avframe [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:83 t:0.083000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:125 t:0.125000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:167 t:0.167000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:208 t:0.208000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:250 t:0.250000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:292 t:0.292000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:333 t:0.333000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:375 t:0.375000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:417 t:0.417000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:458 t:0.458000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:500 t:0.500000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:542 t:0.542000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:584 t:0.584000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:625 t:0.625000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:667 t:0.667000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:709 t:0.709000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:750 t:0.750000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:792 t:0.792000 limit:0.094118 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 0000024a53c79a80] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:834 t:0.834000 limit:0.094118 crop=1920:800:0:140 [out#0/null @ 0000024a53bb1880] video:8KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown frame=   20 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.83 bitrate=N/A speed=11.1x elapsed=0:00:00.07

ffmpeg wants to crop 140 pixels from the right side which it shouldn't. It should say "crop=1920:800:0:0", no?

So yeah, sorry about that  Big Grin

here's the sample: 

https://www.mediafire.com/file/7be1oqtn5...1.mkv/file


Attached Files Thumbnail(s)
   
Reply
#8
Did you try it with the sample you provided? (the screenshot is not from the sample, you provided)

For me Hybrid correctly crops top&bottom 140 pixels to 1920x800. (with the default '-vf cropdetect=24:2'; luma 24, mod 2))
[Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1668 t:1.668000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1710 t:1.710000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1751 t:1.751000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1793 t:1.793000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1835 t:1.835000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1877 t:1.877000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1918 t:1.918000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:1960 t:1.960000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:2002 t:2.002000 limit:24.000000 crop=1920:800:0:140 [Parsed_cropdetect_0 @ 000001e6e6f1e5c0] x1:0 x2:1919 y1:139 y2:939 w:1920 h:800 x:0 y:140 pts:2043 t:2.043000 limit:24.000000 crop=1920:800:0:140
for further explanation "1920:800:0:140" means: crop resolution of 1920:800, positioned at x=0, y=140 in the original image. (0x0 is the upper left corner)
FFmpeg does use another crop syntax than Avisynth and Vapoursynth. Smile

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive. (alternative)
Reply
#9
So that's what "140" means. Then I guess it cropped correctly?

Yes, I tried it on the provided sample. 
But the image is from the same video file albeit not from the sample.

Guess I need to do more reading  Big Grin

Want to try this one ?

https://www.mediafire.com/file/zbgua5w60...2.mkv/file
Reply
#10
There, I get:
1920x1080 with the default values
and
1440x1080 with 'Auto threshold' (added that yesterday) turned on. (and uses 29 as luma border)
About the now cropped "black" in sample2.mkv
The sample is 8-bit yuv420p in limited range, where true black is Y=16.
The side pillars however are not true black:

RegionLuma (8-bit)
Columns 0–239 (left pillar)Y = 25, flat (YLOW = YHIGH = 25)
Picture from column 240about 27–44 near the edge
Fade-to-black frames in the middleY = 16 everywhere

So, you would need to raise the luma border to 26 for Hybrid to detect those borders as black and crop them.

Auto threshold: Hybrid's border probe samples the outermost 2 pixels of each edge. It found them dark and flat, with a highest value of 25, and added a margin of +4. That gives 29. Now 25 ≤ 29, so the pillars count as black, and the first column above 29 is at x=240.
Result: crop=1440:1080:240:0.

The "black" being cropped is a dark grey at Y=25.
cropdetect only accepts it because the probe raised the limit to 29.
The picture's own dark edge starts at about 27, so there are only 2 steps of headroom. On a darker scene the first picture columns could fall below 29 and the crop could come out a bit too wide, but it is correct for this clip. Tongue

=> Hybrid is correct to handle it like it does. Assuming that everything below 28 counts as black is no something that should be turned on by default. Smile (that content probably got a few wrong tv<>pc scale conversions behind it Wink)

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive. (alternative)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)