Skip to content

Instantly share code, notes, and snippets.

@saml
Created June 20, 2018 21:44
Show Gist options
  • Select an option

  • Save saml/64c4e59b6f86a8cf370dc02a84e38802 to your computer and use it in GitHub Desktop.

Select an option

Save saml/64c4e59b6f86a8cf370dc02a84e38802 to your computer and use it in GitHub Desktop.
local mouseX = 0;
local mouseY = 0;
local function onTick(event)
local x;
local y;
x, y = mp.get_mouse_pos();
if x ~= mouseX or y ~= mouseY then
print(x, y);
mouseX, mouseY = x, y;
mp.command('vf-command xcrop x ' .. mouseX .. '"');
end
end
mp.register_event('tick', onTick);
mp.set_property('lavfi-complex', '[vid1][vid2]scale2ref[main][ref]; [main]crop@xcrop=w=200:x=0:y=0:keep_aspect=1[cropped]; [ref][cropped]overlay[vo]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment