View Bug Details

IDProjectCategoryView StatusLast Update
0003008DCP-o-maticFeaturespublic2025-05-05 06:23
Reporterconnor Assigned Tocarl  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Summary0003008: CLI: option to specify crop-fill
Description

CLI option to have input video fill frame completely (whether that be cropping top and bottom or left and right to fill frame)

Example: input video (1.78) crops top and bottom to fit inside a Flat (1.85) container.

Example: input video (2.39) crops left and right to fit inside a Flat (1.85) - not that this would happen often, but still would be nice to have as a feature.

Example: input video (1.85) withe interior aspect ratio of 2.39 crops top and bottom and fits left to right to fit inside a scope (2.39) container.

TagsNo tags attached.
Branch
Estimated weeks required
Estimated work required

Activities

connor

2025-04-15 06:39

reporter   ~0006927

Is this something that can be added in the next version?

carl

2025-04-15 08:33

administrator   ~0006928

As far as I know this is a fairly unusual use-case - I don't remember it being requested in the GUI, for example. Most people are quite averse to cropping a picture just to make it fit a "standard" container, as far as I know.

Would --crop-left, --crop-right etc. CLI options be enough for you, or is the calculation of the required crops also valuable for your use-case?

Can you say a bit more about what you will use this for?

connor

2025-04-16 04:47

reporter   ~0006930

I actually do create quite a bit of DCPs where the file is 3840x2160 with DCI Scope black bars that are baked in. Then I would want to output a DCI scope DCP that crops accordingly. The auto-crop I'm not sure how accurate that is to do that? Where as it is really easy to set the container size to scope and then say fill the container. That is what I would do in DaVinci Resolve is set image to fill frame with crop. This also is the case if I have a 3840x2160 video that I want to create a DCI flat DCP. I would want to create a crop of the video on top and bottom and fill to frame rather than having pillars on the left and right. Just depends from a creative perspective what I want the output to be. The only solution I can think of right now would be to re-encode the video before running through the CLI for dcp-o-matic, but I feel like that is a bit excessive for a small crop.

carl

2025-04-16 14:16

administrator   ~0006931

The way the DCP-o-matic GUI approaches this is that if you crop the black parts off your source image, everything else should be taken care of. Auto-crop should work for this, or I could also add --crop-left, --crop-right etc. so with a 3840x2160 (1.78:1) source has black top and bottom you could say

--container-ratio 239 --crop-top 276 --crop-bottom 276

Or maybe better would be something "automatic" like --crop-for-source-ratio 185 --container-ratio 239.

Any thoughts?

connor

2025-05-03 03:04

reporter   ~0006950

Sorry for the delay in response. I think that could work:
--crop-for-source-ratio 185 --container-ratio 239

Not sure if that is over complicating the command? You could do the same command as:
--crop fill
could also work since you are just saying to fill image to frame. Same as using fill image in css to fill an image to fit in the container. Doesn't matter if it is the left and right or the top and bottom. That could crop left and right or top and bottom either way. You may want to crop left and right if you have a 2.39 interior aspect ratio inside a 1.78 container with black bars. And you could want to crop top and bottom if you have a 1.78 film and you want to send to theaters as 1.85 with no pillars on left and right. Either of those options are pretty common to happen.

carl

2025-05-03 13:58

administrator   ~0006951

Last edited: 2025-05-03 13:58

Not sure if that is over complicating the command? You could do the same command as: --crop fill

This requires DoM to work out where the black parts are though, right? Or did I miss something?

connor

2025-05-05 06:23

reporter   ~0006960

I don’t think it necessarily needs to detect the black bars explicitly. Instead, it could just inspect the source resolution and infer which direction would need cropping when using a --crop-fill type option.

The idea would be that instead of manually specifying crop values, --crop-fill would automatically scale the image to fill the container and then crop the necessary edges—either top/bottom or left/right—depending on the aspect ratio difference between source and container.

For example, if a 3840x2160 (16:9) source is being fit into a 2.39 container, it would crop top and bottom; if the source were vertically taller than the container, it would crop left and right. This would be similar to how "fill frame" works in editing software like Resolve, but with the cropping step handled intuitively, without needing to re-encode beforehand.

Even if the cropped areas aren't black bars, that’s acceptable—it’s just meant to be a quick way to fill and crop in one step, without requiring the user to manually calculate or input pixel values. This is incredibly useful for times when filling a 1.78 video into a 1.85 container and there may not be black bars on that footage.

Bug History

Date Modified Username Field Change
2025-03-26 16:07 connor New Bug
2025-04-15 06:39 connor Note Added: 0006927
2025-04-15 08:33 carl Note Added: 0006928
2025-04-15 08:33 carl Assigned To => carl
2025-04-15 08:33 carl Status new => feedback
2025-04-16 04:47 connor Note Added: 0006930
2025-04-16 04:47 connor Status feedback => assigned
2025-04-16 14:16 carl Note Added: 0006931
2025-04-16 15:49 carl Status assigned => feedback
2025-05-03 03:04 connor Note Added: 0006950
2025-05-03 03:04 connor Status feedback => assigned
2025-05-03 13:58 carl Note Added: 0006951
2025-05-03 13:58 carl Note Edited: 0006951
2025-05-05 06:23 connor Note Added: 0006960