To encode a section of a movie file to a high-quality webm file, use this simple addon for mpv.
Firstly run this command to create a directory to put the lua script.
mkdir -p ~/.config/mpv/scripts |
Then download the required script to the directory we created.
This is located on this Github.
https://github.com/ekisu/mpv-webm.
wget -O ~/.config/mpv/scripts/webm.lua https://github.com/ekisu/mpv-webm/releases/download/latest/webm.lua |
Once this is done, load a movie and press Shift-W to display an OSD interface that displays the keyboard shortcuts to capture a section of a movie to a webm file.
Just press 1 to set the start time of the webm and then press 2 to set the endpoint and e to encode the file. It is as easy as that.
This is an example of the webm quality I got with this simple add-on script. This is a great way to capture a section of a video as a webm file to share online.
To remove the audio from the webm file, use this ffmpeg command.
ffmpeg -i Guns.Akimbo-audio.webm -c copy -an Guns.Akimbo-nosound.webm |
The -c copy -an
parameters remove the sound from the file, and transfer the video intact.
This is a very useful tipf or sharing clips of a video online with small file-size.
2 thoughts on “How to encode a section of a movie to a webm file with mpv.”