Can't get autocrop to select the entire black bars

Request Type:
BUG / NEW FEATURE
Bug?
MCEBuddy Version and Type (32bit or 64bit):
latest 64bit / 2.5.1
Operating System and Type (32bit or 64bit):
win10 x64
Summary of the problem or suggestion:
Crop not working (or possibly crop values not really detected)
Steps to replicate the bug:
Downloaded TV Movie as TS, tried to convert as TS (H.264/AC3) with enable cropping flag set, no changes in profile.conf
Screenshots:

I used ffplay to detect cropvalues and it showed (ffplay -i “In guten wie in schweren Tagen.ts” -vf “cropdetect=24:16:0”)

x1:1 x2:719 y1:58 y2:505 w:704 h:448 x:10 y:58 pts:556519 t:6.183544 crop=704:448:10:58

Screenshot of original file and file played with ffplay and cropvalues 704:448:10:58 attached

Log-file shows the following:
2019-11-09T20:52:16 MCEBuddy.AppWrapper.Handbrake --> + autocrop: 38/70/2/0

Can you help?


In guten wie in schweren Tagen.ts-Remove Ads-2019-11-09T20-49-52.1155442 01-00.log (1.1 MB)

Handbrake does auto cropping

INFORMATION> 2019-11-09T20:52:15 MCEBuddy.Transcode.ConvertWithHandbrake → Handbrake auto video cropping

You can switch your encoder order=ffmpeg if you want ffmpeg to detect the cropping or you can create a custom profile with your own cropping parameters.

Thanks Goose,

will try it with ffmpeg.

But allow me to ask, how would that profile look like? How would I handover the parameters for cropping correctly?

Here our TV operator keep me quite busy as some shows switch the resolution during the programme (best known from Top Gear). I found that -ss 600 is somewhat a good value to start the search with ffmpeg. But how would that apply to a profile?

Many thanks

Most stock profiles use both handbrake and ffmpeg (as a fallback) but the order varies so it’s easy to switch them.

In your case:

→ Profile being used : TS
→ order=handbrake,ffmpeg

The encoder profiles for both ffmpeg and handbrake are already in your profile. Just make a copy of your TS profile (or change it) and switch

order=handbrake,ffmpeg

to

order=fmpeg,handbrake

Thanks Goose,

so I switched the sequence to use ffmpeg first, but I fear the crop still isn’t detecting well, as there is still a black bar at the top and bottom. A bit less, but still very visible. I guess I’ll crop manually, unless you have any further advice for me.

Thanks

I noticed that your channel logo is extending into the black bars area which is why auto cropping probably isn’t never to going to pick the whole bar. It sees video content and cropping tends to be symmetrical. If you want to get rid of the entire section including cutting into the logo then you’ll have to do via a custom profile with a custom crop selection (and turn off auto cropping in MCEBuddy so it doesn’t overwrite your settings)

Hi Goose,

thanks for your reply. For the above video you are right. But unfortunately I tried with another one where the logo is not extending to the black bar on top (fully inside the actual video). The black bars where slightly cut, but still some part of the black bar was there (about 50%).
Adding crop values is not so much the issue. The comfortable thing would have been to automatically hand-over the crop values to MCEBuddy, which is a manual task :slight_smile:
Thanks
Bernd

The way it works is that mcebuddy scans the video stream looking for pure black bars, if there are any pixels which aren’t black then it’s considered as video, so I’m guessing somewhere during the video those bars aren’t black and hence to be safe the auto crop will not remove them.

Hi Goose,

sorry for the long text. But I wanted to explain my goal.

Indeed, that could be during a commercial break, which I would not want to consider, as it is cut anyhow.
But using command line ffmpeg for cropdetection seems to work as I would want it to. So this is some kind of prove that it is possible using ffmpeg.
For example (for one minute):
ffplay -ss 600 -i “Singh Is Bling.ts” -vf “cropdetect=24:16:0”
detects the correct values
and if I play it then with
ffplay -ss 600 -i “Singh Is Bling.ts” -vf “crop=704:448:10:58” (in this example)
all is fine (for the whole movie)

Is there a way to tell MCE buddy how to use cropdetection? For instance after how many seconds and for how long?
If not, could I make it a feature request :smile:

What I typically try to achieve and I have no idea, if I can achieve this somehow via profile.conf:
ffmpeg -i “Pitch Black - Planet der Finsternis.ts” -map 0:v -c:v h264_nvenc -vf “crop=1280:544:0:88” -aspect 16:9 -crf 16 -qmin 16 -qmax 26 -f mpegts -map 0:a -c:a:0 ac3 -b:a:0 448k -c:a:1 ac3 -b:a:1 192k -c:a:2 ac3 -b:a:2 192k -af “dynaudnorm=p=1:m=50:s=0:g=11” -map 0:s:1 -scodec copy output_crop.ts -y

  • Removing commercials (via MCEBuddy and comskip)
  • Compressing it to H.264 (Nvidia HW) and placing it in a .TS container
  • Cropping it to remove black bars on top and the sides and applying a 16:9 ratio for my TV (well after manually detecting crop settings)
  • Using the original audio tracks with amplification, using original bit rates and codecs despite varying amount of tracks and codecs used. Could be one track mp2 only or up to 5 tracks (multilanguage) with a mixture of ac3 and mp2 (after manually retrieving audio channels and bitrates)
  • Copying the subtitle tracks unchanged
  • Applying some video quality things

Mostly I want to get rid of doing manual steps.

Guess MCEBuddy will not really be able to help me here, won’t it?

Many thanks for your help.

You don’t need the quotes

Create a custom profile and in the ffmpeg-video section add your custom crop settings.
Then also set the SkipCropping=true directive in the profile (this causes MCEBuddy not to use its own crop detection and rely on the custom crop settings you specified in the profile. See this topic for more details on it: MCEBuddy - Advanced Settings, Commands and Tweaking