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

MPV crop video playback/cut the part of the video into new file - How to install and use it #54

Open
slrslr opened this issue Jun 11, 2021 · 0 comments

Comments

@slrslr
Copy link

slrslr commented Jun 11, 2021

Here is what worked for me on Linux to setup the cropping and cutting MPV player scripts:

Setup/3 commands:

  1. for i in encode crop; do wget https://raw.githubusercontent.com/occivink/mpv-scripts/master/scripts/$i.lua -O ~/.config/mpv/scripts/$i.lua; done
  2. echo -e "\n\n# crop.lua - c/C keys and then click+click to select crop rectangle; d key to reset, l key to obfuscate the logo\nc script-message-to crop start-crop hard\nalt+c script-message-to crop start-crop soft\nl script-message-to crop start-crop delogo\nd vf del -1\n\nC script-message-to crop toggle-crop hard\n\n# encode.lua\ne script-message-to encode set-timestamp\nalt+e script-message-to encode set-timestamp encode_webm\nE script-message-to encode set-timestamp encode_slice" >> ~/.config/mpv/input.conf
  3. sed -i "s|-an -sn||g" ~/.config/mpv/scripts/encode.lua
  4. quit MPV player, open the media file

Usage (keyboard keys for MPV):
e,e - define cut points, make new cut file(no HW encoding)
c/C and mouse clicks - crop the video playback
l (lowercase L) and mouse clicks - dissolve/obfuscate logo, seems to work for playback not for cut new file

For Windows, i think one would have to manually copy scripts and append the contents of input.conf into the %appdata%\mpv *.conf file :-/ setup is not easy, can be good if these features are built in mpv mpv-player/mpv#4639 .

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

No branches or pull requests

1 participant