Can't remove letterboxing - SC is padding the content

What is your operating system?
Windows 10 x64

What is your Shotcut version (see Help > About Shotcut)? Is it 32-bit?
20.10.31 x64

Can you repeat the problem? If so, what are the steps?
I’m having trouble removing letterboxing from a video. Goal is to apply some other filters then export the result at the original resolution, but without the letterboxing. For preservation of maximum detail, I don’t want any re-scaling (1:1 pixels from input to output). When I am editing, SC is giving me a small black band on the bottom of the preview window. When I export with x264 lossless, that black band is covering the bottom 4px of the video.

My source video is 1920x1080 with 130px of padding top and bottom. I set a custom video mode of 1920x820 resolution and 1920x820 aspect ratio, which are the dimensions of the actual content of the video. Size, Position & Rotate filter to set 100% zoom and position it at 0,-130. In theory(?), my content covers the full extents. Actual result, SC is covering up some of the content in both the preview and export.

I made a dummy video to demonstrate. Intentionally ugly color scheme. The letterboxing I want to remove is green (130px top and bottom); the content I want to keep is yellow (1920x820, centered top-to-bottom). See attached screen shot and files. Also is a sample export using x264 lossless that shows the black bar at the bottom. If you make the y-coordinate of the Size, Position & Rotate filter higher or lower, you can the green bands from the source to show up at the top or bottom of the preview window, but the black bar never goes away.

1920x820 Letterbox.zip (83.9 KB)

1 Like

This is odd, but when I open your provided project, I do not reproduce the problem you report. I use the Video Zoom Scope to look at pixel 1:820 and it shows yellow.

Maybe try to close and reopen the project?
Does the video zoom scope show something different for you?

Exit and re-launch, open .mlt: still a black bar on the bottom. (1,820) pixel is black. See attached screen shot and application log.

Application Log.zip (4.1 KB)

Well that is very odd. I am also testing 20.10.31 x64 Windows 10 x64 and I do not recreate the problem when I open your project or when I recreate your project from scratch using your instructions.

There must be something different either in your environment or with one of your settings. From inspecting your log, I can see

  • Decimal is “.”
  • Interpolation is bilinnear
  • Preview scaling is off
    That all matches my system.

I would suggest to try to change some settings and see if any setting affects the problem.

Hopefully someone else will open your project and will be able to recreate the problem.

1 Like

Your Size Mode is Fill, rather than Fit
shotcut_2020-11-21_15-35-41
Looking at an exported video frame in Gimp.
gimp-2.10_2020-11-21_15-32-59 gimp-2.10_2020-11-21_15-32-08

Size Mode: Fill has shrunk your image by 75.9%, thus changing your image size to 1458x820.
When hitting reset on Zoom, you get the 0,-130 1920x1080
When typing in 100% on Zoom, you get 0,-140 1920x1100
No padding, rather the image is positioned at 0,-130, rather than 0,-140.

This is at Position 0,-130
gimp-2.10_2020-11-21_15-27-59

Changing Position 0,-140, thus changing Size to 1956x1100
gimp-2.10_2020-11-21_16-07-02 gimp-2.10_2020-11-21_16-07-43

It would be easier to use Crop:Source. This option doesn’t stretch the source video/image.
Click “Center”, and leave Center bias as 0px.
shotcut_2020-11-21_15-43-17

This is the correct way to be doing this.

1 Like

I think I followed Hudson555x’s recommendation, but still could not get rid of the black bar. See attached screen capture. When I do size mode: fit, then reset on the zoom, it’s still showing a black bar on the bottom. I think (?) I matched the same settings as Hudson555x’s screen shot, but you can check me in the screen capture.

Moving the y-position down, shows the green padding from the source show up on the top. Moving the y-position up, shows the green padding from the source show up on the bottom, but the black bar is still there between the bottom of the frame and the content. Also in the screen capture.

Size and Position.zip (531.1 KB)

I also did crop: source per his recommendation. The preview window looks correct (i.e. no black bar at the bottom this time). I did not try a sample export, but assume it would be right. Thanks.

Given that I have a solution, my immediate problem is solved.

HOWEVER, the two methods should produce identical output, shouldn’t they???

You moved the position to 0,-140, which is not what I did in my first image.
2020-11-21_18-22-45

At 20 seconds in your video, you’re looking at the VUI (Visual User Interface) for the size of your original source video/image. This is not a part of your exported video.
2020-11-21_18-25-20

1 Like

Conceptually, yes, and similar issues have been raised; but this filter resamples and uses real numbers (float) and thus susceptible to rounding errors and unable to guarantee pixel grid fitting. We welcome any code patches from someone to improve it, but I am not working on it it any time soon.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.