Wiktor's Website


Easy clip/gif making with mpv-webm

Are you too lazy to input precise timestamps into ffmpeg? Or maybe don't know how to use video editing software? This cool mpv script I'm gonna show you will let you easily make a clip of a video you're watching without even having to minimize it.

Installation & Usage

  1. Download mpv - if you're on Linux you probably already use it, if not install with your package manager, for Windows - here you can grab the installer.
  2. Download webm.lua along with webm.conf from this github page.
  3. Go to ~/.config/mpv (or %APPDATA%\mpv on Windows) and make 2 directories - scripts and script-opts, if they exist, ommit this step.
  4. Put webm.lua in scripts folder, and webm.conf in script-opts.

And that's it, now we're ready to use the script.
Default keybinding for opening it is Shift + W, you can mark start time with '1' and end time with '2'. Click 'e' to encode.

Protip: Use ',' and '.' to scroll the video frame by frame.

How the script looks in mpv

Youtube clips

Great thing about this script is ability to make clips from youtube without needing to download the video itself.
You need yt-dlp for that, then just
mpv [url]
and make the clip. Also, yt-dlp supports much more sites than Youtube, so you can do the same thing with them too.

For more info about configuration refer to the script's github page and .conf file which is quite well commented.