Skip to main content

Just another bikeshed to encode webm VP9 videos. Nothing interesting here.

Requirements

  • Python 2.7+ or 3.2+

  • FFmpeg 2+ compiled with libvpx and libopus

  • mpv 0.8+ compiled with Lua support, for interactive mode only

Installation

Just save https://raw.githubusercontent.com/Kagami/webm.py/master/webm.py

Optionally put it somewhere in your PATH:

mkdir -p ~/.local/bin
wget https://raw.githubusercontent.com/Kagami/webm.py/master/webm.py -O ~/.local/bin/webm
chmod +x ~/.local/bin/webm
export PATH=$PATH:~/.local/bin
webm -h

Or with pip:

[sudo] pip install webm

Usage

NOTE: Windows users may want to add Python executable to the PATH. See https://docs.python.org/3/using/windows.html#excursus-setting-environment-variables for details. Otherwise just type the full path to your python.exe location instead of python.

Show help:

python webm.py -h

Examples:

# Fit video to default limit
python webm.py -i in.mkv

# Fit video to 6 MiB
python webm.py -i in.mkv -l 6

# Set video bitrate to 600k
python webm.py -i in.mkv -vb 600

# Constrained quality
python webm.py -i in.mkv -crf 20

# CQ with custom limit
python webm.py -i in.mkv -crf 20 -l 6

# CQ with custom bitrate
python webm.py -i in.mkv -crf 20 -vb 600

# Constant quality
python webm.py -i in.mkv -crf 20 -vb 0

Interactive mode

Pass -p flag to interactively select cut frargment/crop area with mpv. Demo:

image0

License

webm.py - encode webm videos

Written in 2015 by Kagami Hiiragi kagami@genshiken.org

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.

Release files for webm 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webm 0.3.4
File Size Uploaded
webm-0.3.4.tar.gz 14.7 kB Details

Release files / webm-0.3.4.tar.gz

Download URL webm-0.3.4.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8c5073841d08c039132fc843321d4a9b89069be626c009774c535d55ced2b4ae
BLAKE2b-256 checksum
How to use checksums
e0d3f8c6d5967c10e617c337cee20339793c2f6b404c390700026c89c913119a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.12.1

2 release files

0.12.0

2 release files

0.11.0

1 release file

0.10.0

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.1

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

This release

0.3.4 This release

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.1.2

1 release file

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page