Simple WebM maker for mpv, with no external dependencies.
Place this in your mpv scripts folder. The scripts folder can be found (or created, if it does not already exist) in the following paths:
- Linux/macOS:
~/.config/mpv/scripts, where~is your user's home folder; - Windows: mpv will try to load scripts from
%APPDATA%\mpv\scripts, followed by<mpv binary folder>\portable_config\scriptsand<mpv binary folder>\mpv\scripts; where%APPDATA%is a Windows-specific directory (typing%APPDATA%on Windows + R should take you to that folder), and<mpv binary folder>is the folder that contains thempv.exebinary.
Additional details about the folder structure can be found in the mpv's manual.
Encoding starts a separate mpv process. The mpv executable must be available on the PATH inherited by the player, including when the player is opened from a desktop shortcut or file manager.
- Windows: follow the Windows encoder setup guide for step-by-step instructions to add mpv to
Path, verify it, and troubleshoot desktop launches. - Linux/macOS: run
command -v mpvto check your shell'sPATH. If encoding reportsmpv: command not foundwhen launched from the desktop, ensure that launch environment also includes the executable's directory. Homebrew commonly installs it in/opt/homebrew/binon Apple Silicon and/usr/local/binon Intel Macs.
If encoding instead reports a missing codec, check mpv --ovc=help for video encoders or mpv --oac=help for audio encoders. These lists come from the FFmpeg libraries used by mpv; installing a separate ffmpeg executable does not necessarily add codecs to mpv. On macOS, the Homebrew formula (brew install mpv) is one source of an encoder-enabled build.
By default, the script is activated by the W (shift+w) key.
Follow the on-screen instructions. Encoded WebM files will have audio/subs based on the current playback options (i.e. will be muted if no audio, won't have hardcoded subs if subs aren't visible).
Press u (encode & upload) on the WebM maker page to encode a clip and upload it in one step. The destination is set in the options (o) and stored in webm.conf:
upload_host—catbox(permanent) orlitterbox(temporary).litterbox_time— expiry for litterbox uploads:1h,12h,24hor72h.catbox_userhash— optional Catbox account hash; account uploads are permanent and manageable.upload_curl_path— thecurlexecutable used for the multipart upload.open_after_upload— open the link in the browser as soon as it is ready.
Uploads use curl; when it is not on PATH, the u line is hidden. The resulting URL is copied to the clipboard (mpv's clipboard/text when available, otherwise wl-copy, xclip or pbcopy). Only the Catbox services are supported: Streamable requires an account for uploads, so it is not offered.
You can configure the script's defaults by either changing the options at the beginning of the script, or placing a webm.conf inside the script-opts directory. A sample webm.conf file with the default options can be found here. Note that you don't need to specify all options, only the ones you wish to override.
Building requires moonc, the MoonScript compiler, added to the PATH, and a GNUMake compatible make. Run make on the root directory. The output files will be placed under the build directory.
