Posted: . At: 8:48 AM. This was 6 years ago. Post ID: 11794
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

How to encode a section of a movie to a webm file with mpv.

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.

Webm capture OSD.
Webm capture OSD.

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.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.