Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop properties window could have "absolute size" mode. #1840

Closed
singalen opened this issue Jul 11, 2018 · 10 comments
Closed

Crop properties window could have "absolute size" mode. #1840

singalen opened this issue Jul 11, 2018 · 10 comments
Labels
💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot stale This issue has not had any activity in 60 days :(

Comments

@singalen
Copy link

singalen commented Jul 11, 2018

Is your feature request related to a problem? Please describe.
I want to crop video to a Youtube compatible size, in order for it not to get re-compressed again.

I cannot set exact pixel size with only "fraction of a image size" control.

Describe the solution you'd like
A switch (two switches?) in Crop properties that changes the way left/right/up/down crop margins work: see and edit the cropped piece size - or the cropped piece AND the remaining piece - in pixels.
A read-only field that shows the resulting area size would be much appreciated too.

Describe alternatives you've considered
None inside OpenShot, AFAIS.

screenshot 2018-07-11 15 34 15

@peanutbutterandcrackers
Copy link
Contributor

Describe alternatives you've considered
Er, not using OpenShot? Sorry.

How rude!! 😆

Anyways, thank you for the neat enhancement idea. 👍

With the scare number of devs we have, this might take quite a while, though...

@peanutbutterandcrackers peanutbutterandcrackers added the 💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot label Jul 12, 2018
@singalen
Copy link
Author

singalen commented Jul 12, 2018

Ah, I have already edited that away. On a second thought, it wasn't that funny. Sorry.

I also added another suggestion to the first comment:

A read-only field that shows the resulting area size

That must be quite cheap but useful change, and it will even allow tuning exact pixel size by manually typing long decimal fractions into the crop size fields.

@peanutbutterandcrackers
Copy link
Contributor

I'd really like it if you could join us, good sir. We are really lacking when it comes to volunteers. Please watch this video for some idea regarding the lack of volunteers. 😄

@singalen
Copy link
Author

Thank you very much for your trust. I promise to take, er, a shot at it, but I'm already about overcommitted.
Last time I tried to build it, I couldn't install Qt5Widgets on my mac. Will see if I can get something done in Python area.

@peanutbutterandcrackers
Copy link
Contributor

Since you also seem to be building on a mac, I'd just like to ping @steinybot here. And perhaps even @DylanC. I think we should really get a page compiled for how OpenShot can be built on macs. [And I don't own one. GNU/Linux FTW! 😄 ]

@steinybot
Copy link

To be fair, mac instructions are pretty good.

I did raise OpenShot/libopenshot/issues/129 since it was missing cppzmq and there was nothing in homebrew for it. I created a custom tap which you can use (https://github.com/BotTech/homebrew-outcasts).

The issue that I am still stuck on is getting imagemagick to compile for c++11. I have raised https://stackoverflow.com/questions/51122417/why-are-these-symbols-not-found/51156617#51156617 and https://www.imagemagick.org/discourse-server/viewtopic.php?f=2&t=34282 but I haven't been able to get past it.

@ferdnyc
Copy link
Contributor

ferdnyc commented Sep 17, 2018

One tricky thing about having Crop work with pixel dimensions is that, technically, the video doesn't have pixel dimensions yet. ...Technically.

The input video does, but for the output video, they're still not finalized. The pixel dimensions of the output video are defined by the export profile, so they aren't defined until the export is actually performed. The "working" dimensions are controlled by the project profile, but that can also be changed. That's why the crop dimensions are stored portably, as percentages of the full dimensions: if you change the profile from 1080p to 720p, your crop region doesn't move. And if you then export at 720x480 for anamorphic widescreen DVD, the cropped size is adjusted to account for the different pixel dimensions (DAR).

Because of this, also, OpenShot's Crop effect may not do what you think. If i import a 1080p video, add a Crop effect with the default 10% on all sides (resulting dimensions, 1536x864), and then export at 1080p, I'm going to get... a 1080p video with 10% black bars on all four sides. If I export at 720p, I'll have a lower-res version of the exact same video, still with 10% black bars on all sides.

Since the output dimensions are governed by the export profile, and the Crop effect can't change those dimensions, the effect isn't really super useful for direct video cropping. It's more intended for compositing. (e.g. You might import a video, crop off something unwanted in the bottom 20%, and replace it with other content, like titles or captions.) If you just want to crop a video to set pixel dimensions, it's often easier to do it in something like HandBrake or avidemux before importing.

If you were to use OpenShot to crop a larger video down to a target output resolution, you wouldn't want or need to use Crop (the effect) anyway, and you wouldn't have to worry about pixel math. The easiest way would be to do this:

  1. Set your project profile to match the output dimensions
  2. Place the video on the Timeline
  3. Set the Scale parameter to None
  4. Adjust the Location X/Y parameters to move the cropping "window"
  5. (if necessary) Adjust the size of the input relative to the output using the Scale X/Y parameters

The Crop effect won't get you to that goal, regardless of the units it displays its parameters in. And having it work in pixel units would be misleading, arguably, since they're dependent on the export parameters.

@singalen
Copy link
Author

Thanks for explanation.

So "crop" doesn't mean "cut the edges off and stretch" but "replace edges with black bezel"? Do many people use such an effect?

This may be a sign that the model needs to be adjusted.

Or here's an idea: could there be a "Crop input video" effect? It could apply to the given input tracks if and only if they have the same dimensions and orientation.

@ferdnyc
Copy link
Contributor

ferdnyc commented Sep 17, 2018

No, Crop does trim the video, it's just that it does it relative to its placement in the output frame, and that's determined before the cropping is done (because Crop is an Effect). It's very useful for picture-in-picture type scenarios, where you might want to show a certain portion of a video overlaid on a larger background video. Then you'd use a combination of the Scale parameters and the Crop effect, to reduce the visible size of the "inner" clip. The reason you get black bars when using Crop on a single clip is that there's nothing behind it to show through.

I'm not sure OpenShot's video pipeline is really equipped to applying effects before placement, that's not really their role. But since there's an implied crop to the output frame, I'm not sure an Effect is needed in that instance. If you want your output video to be a certain size, you set that with the Project Profile and the cropping is effectively automatic. (Though, if you don't want clips to be autoscaled to fit that frame, which they will with the default Best Fit scaling, you'd need to adjust the Scale parameters.)

@stale
Copy link

stale bot commented Oct 27, 2020

Thank you so much for submitting an issue to help improve OpenShot Video Editor. We are sorry about this, but this particular issue has gone unnoticed for quite some time. To help keep the OpenShot GitHub Issue Tracker organized and focused, we must ensure that every issue is correctly labelled and triaged, to get the proper attention.
This issue will be closed, as it meets the following criteria: - No activity in the past 180 days - No one is assigned to this issue
We'd like to ask you to help us out and determine whether this issue should be reopened. - If this issue is reporting a bug, please can you attempt to reproduce on the latest daily build to help us to understand whether the bug still needs our attention. - If this issue is proposing a new feature, please can you verify whether the feature proposal is still relevant.
Thanks again for your help!

@stale stale bot added the stale This issue has not had any activity in 60 days :( label Oct 27, 2020
@stale stale bot closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot stale This issue has not had any activity in 60 days :(
Projects
None yet
Development

No branches or pull requests

4 participants