Converting 16:9 to 4:3 with crop:source?

I loaded a 1980x1080 video into the timeline. The video mode of the project ist 1440x1080.
Used the Crop: source filter to remove 370 pixels at the left side and 170 pixels at the right side to get a 1440x1080 size video. Exported with 1440x1080 resolution and 4:3 aspect ratio.
The resulting video is 1440x1080 size, but there are black bars at the left and right side ?!?
I’m new to Shotcut and I think this is not a bug but I’m doing something wrong.

If you want your video to be 1440x1080, then you have to set your Video Mode to that resolution.

  1. Settings - Video Mode - Custom - Add
    shotcut_2021-10-10_16-37-01

  2. Open your video into Shotcut.

  3. Crop:Source filter, tick the box for Center (Or adjust left/right)
    2021-10-10_16-43-46

  4. Export as normal, no need to enter into advanced.

Using your settings with Crop Source with a 1980x1080, gets me this:
Yellow to show what would be black bars.

For an actual sized source video of 1980x1080 (not 16:9), to have it centered it would be 179 px left/right.

1920x1080 (16:9), to have it centered it would be 180px left/right.

Me stupid… :roll_eyes:. of course the source video is 1920x1080, not 1980x1080!
But I still don’t understand why I only have to remove 360 pixels to get the 4:3 aspect ratio? 1920-1440=480 pixels.

firefox_2021-10-11_17-42-13

480/1.33=360.9022~

Maybe I don’t understand what the Crop:Source does. I think cropping the left and right side removes columns of pixels, cropping the top and bottom removes rows of pixels, is this correct?
When I crop a 1920x1080 video in Apple Compressor, I have to remove 480 columns of pixels to get a 1440x1080 video. That is very logical to me. When I want to do the same in Shortcut, I have to remove 480/1,33=360,9 columns of pixels. Apparently there is a different logic to the cropping in Shortcut than in Compressor, but I’m really scratching my head how the aspect ratio comes into the equation. I could just take a note, but it would be better to understand it. It would be nice if you could explain this to me!
By the way - where can I find a manual?

Kind of, press F1 in Shotcut as you would expect (well, maybe not on macOS), and it leads you to #docs, which is a slow work-in-progress with very little contribution. However, this topic is represented. Since the docs are made using the forum software, you can also use the search here, and the #docs get the highest priority. Hint: for best results search using the exact name as what you see in the English UI.

With respect to your problem, with the introduction of proxy editing, I had to change the pixel units to no longer be in terms of the source but rather the project resolution (Video Mode). That is often less intuitive, but think about it this way: The guts of the Crop: Source filter is in a deeper layer of the software that knows nothing about proxy. All it knows is the video file it has (proxy is lower resolution) and the project resolution. If you ask it to crop 240 from each side of a 640x360 proxy video, for example, that is going to look very wrong! In any case, if you are fine to crop equally from both sides you could have simply clicked the Center check box and you are done. When it comes to manual cropping most people are likely eye-balling instead of using math (or the less efficient Size, Position & Rotate filter).

Thank you for that clarification. I had noticed a change in behavior since proxy was introduced and I assumed this was the reason, but didn’t want to parrot it without verification.

To the OP, the math works like this:

Source video:
1920x1080 (16:9)

Timeline resolution:
1440x1080 (4:3)

The source video will be implicitly shrunk by Shotcut to fit within the 4:3 timeline. This is default behavior that happens even without a Crop or SPR filter.

Source video resolution shrunk to fit inside the 4:3 timeline:
16/9 = 1440/x
x = 810
1440x810 (16:9 that fits within the 4:3 width, causing black bars on top/bottom)

What width would create a 4:3 ratio at a height of 810 pixels?
4/3 = x/810
x = 1080
1080x810 (after the 16:9 source is shrunk to fit within 4:3 timeline, then source itself cropped to 4:3)

How many left/right pixels need to be cropped to reach this 4:3 width?
1440 (from 1440x810 at 16:9) minus 1080 (from 1080x810 at 4:3) = 360 cropped

So crop 360 total pixels, such as 180 left and 180 right.

Basically, the math is a little complex because the crop units are not happening “directly on the source”. The crop units are in timeline resolution units. As @shotcut said, this keeps the crop amount consistent (because it’s used as a percentage against the timeline resolution) which enables the underlying video file to change resolution (such as a proxy swap). Without this, a pixel-based crop unit would cut off different amounts of the source if the source resolution changed due to proxy or any other reason.

2 Likes

Thanks a lot Austin for the detailed explanation, now this make sense for me :slight_smile: !
I will certainly have to look at this calculation more often until I can apply it by heart …

@shotcut:
A good manual would certainly increase the utility of the program significantly. Not everyone has the nerve to learn software by trying and guessing. I always find it a shame when the unbelievable amount of work for programming software is offset by minimal effort for documentation. But programmers seem to hate to write manuals, or is that a prejudice?

Documentation for Crop: Source has been completely searchable.
firefox_2021-10-13_17-37-12
4.4k views