8000 Add video panning by moex3 · Pull Request #207 · Aegisub/Aegisub · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add video panning #207

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Add video panning #207

wants to merge 13 commits into from

Conversation

moex3
Copy link
@moex3 moex3 commented Nov 23, 2020

Add the ability to move the preview video around, and add a menu item to reset the panning.

It's a little bit hacky, as i got this to work by trial and error.

I tested it on windows with the wangqr fork (as i was able to build that), and on linux with xorg. Both works fine, however on wayland the zoom anchor seems to be in the bottom left corner instead of the upper left one and that breaks the mouse position. But this requires more testing.

It can be used by dragging, with the middle mouse button.
Example video

closes #187, closes #107

@coveralls
Copy link
coveralls commented Nov 24, 2020

Coverage Status

Coverage remained the same at 0.0% when pulling 402b8d4 on moex3:pan_video into 6f54695 on Aegisub:master.

Crosshair drawing is broken when videoAr != displayAr
I'm not sure about that scale_factor, i don't know how to test that
Ristellise added a commit to Ristellise/AegisubDC that referenced this pull request Jan 30, 2021
We now kinda have proper video panning, lol.
@megax
Copy link
megax commented Mar 21, 2021

I solved a couple of years ago. I think it's more perfect that way.

https://drive.google.com/file/d/150QXmgTLgTmVBdu0Zbo_3CLPttpbwGMz/view?usp=sharing

@moex3
Copy link
Author
moex3 commented Mar 21, 2021

@megax Yeah that looks good, i was also considering stopping the zoom from changing the preview window size, but haven't got around to it yet (and i don't feel like i'm being pressured, looking at the state of the project).

I tried searching for this feature a while ago, found nothing just github issues with 0 progress on them, so I considered it non-existent. Is it Haru-Subs private :D ? If not, create a PR please.

@megax
Copy link
megax commented Mar 22, 2021

@moex3 Yeah sorry, the code is private. I exclusively developed it for our group in 2018 and our group and it stays exclusive for the time being. I just sent the video, so you can take a look at what it "should" look like. Our Aegi contains quite a few more features besides this, so it's not a little project. These mechanics took a lot of time to figure out. Sorry for getting you excited, but I really can't publicize it, since it belongs to our team(now Guddo-FanSub).

moex3 added 4 commits April 21, 2021 00:19
with a "good enough" implementation
The preview window would change in width, when the video was being zoomed.
Possibly, because on windows, zooming only calls UpdateSize once, but on
linux, it gets called multiple, like 8 times.
Rounding fixed it.
@moex3
Copy link
Author
moex3 commented Apr 20, 2021

Some updates!

Now the video can be zoomed without affecting the displaying window size. Scrollwheel zooms the video, and ctrl+scrollwheel zooms the entire preview window. Zooming centers around the cursor. Zooming now feels more linear, but don't zoom too much, it gets weird. Also, this implementation of it is not perfect, as after a zoom-in, a zoom-out does not result in the original video size. Zoom-zoom.

Preview:

prev2.mp4

@megax
Copy link
megax commented Apr 27, 2021

@moex3
Video window default (my code sample) ~ (ctrl+0)
Set:

void VideoDisplay::OnKeyDown(wxKeyEvent &event) {
	hotkey::check("Video", con, event);

	// Zoom 1.0
	if(event.ControlDown() && (event.GetKeyCode() == '0' || event.GetKeyCode() == WXK_NUMPAD0)) {
		auto provider = con->project->VideoProvider();
		if (provider && IsShownOnScreen()) {
			isresetzoom = true;
			ResetZoom(); // set zoom value 1.0 etc
			last_videoSize.Set(provider->GetWidth(), provider->GetHeight());
			UpdateSize();
		}
	}
}

I'm not entirely sure, that this is how it's supposed to be added.
This requires editing the already existing hotkey.json file (shows path
in log, if it exists).
Should this also be added to hotkey.cpp?
@seiya-eyth
Copy link
8000

Hi! @moex3 ,thanks for this beautiful useful feature, but i don't know how to install it in my aegisub, can you help me please.

@moex3
Copy link
Author
moex3 commented Mar 2, 2022

Hi @seiya-eyth!

You can use AegisubDC, which is a fork of aegisub that has this PR merged.

milahu pushed a commit to milahu/AegisubDC that referenced this pull request Mar 2, 2022
We now kinda have proper video panning, lol.
This reverts commit 3d525d9.
The default hotkey is not required. People can just add a custom one
from the hotkey settings if they want this.
@seiya-eyth
Copy link

@moex3 it worked and i can zoom now. But the json and cpp files, where i have to paste them ?

@moex3
Copy link
Author
moex3 commented Mar 3, 2022

@seiya-eyth Those files are only needed if you want to build aegisub from source code. AegisubDC provides already built exe files, so if you downloaded that, and it works, then it's fine. You have nothing else to do.

The json file was used to set a hotkey to reset the video zoom. You can set a custom one for it in the settings if you want that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video Zoom Issues Video view panning
4 participants
0