项目作者: Kagami

项目描述 :
:film_strip: Cross-platform command-line WebM converter
高级语言: Python
项目地址: git://github.com/Kagami/webm.py.git
创建时间: 2015-04-16T00:31:39Z
项目社区:https://github.com/Kagami/webm.py

开源协议:Other

下载


webm.py PyPI version Build Status

Cross-platform command-line WebM converter.

Features

  • No Python dependencies, single source file
  • Supports encoding to VP8, VP9 and AV1, with Opus or Vorbis
  • 2-pass encoding, user-friendly defaults, flexible set of options
  • Provides graphical interactive mode to cut/crop input video with mpv
  • Can burn subtitles, fit to limit, use external audio track and many more

Requirements

  • Python 2.7+ or 3.2+
  • FFmpeg 2+ compiled with libvpx and libopus
  • mpv 0.17+ compiled with Lua support, for interactive mode only

Make sure to set Add to PATH option in Python for Windows installer.

FFmpeg and mpv executables must be in PATH or set their location with
WEBM_FFMPEG and WEBM_MPV environment variables.

Installation

  1. pip install webm

Or just save https://raw.githubusercontent.com/Kagami/webm.py/master/webm.py
and put in your PATH.

Windows, Python 2 and non-ASCII filenames

Unicode filenames won’t work on Windows with Python 2 due to Python bugs. Use
Python 3 if you can but if not an option set PYTHONIOENCODING environment
variable to utf-8 and run:

  1. pip install subprocessww

Usage

Show help:

  1. webm -h

Examples:

  1. # VP9 with default quality
  2. webm -i in.mkv
  3. # Fit to 10 megabytes
  4. webm -i in.mkv -l 10
  5. # Set 1000kbps video bitrate
  6. webm -i in.mkv -vb 1000
  7. # Change quality
  8. webm -i in.mkv -crf 20
  9. # Encode to AV1
  10. webm -i in.mkv -av1
  11. # Encode to VP8 & Vorbis
  12. webm -i in.mkv -vp8

Interactive mode

Pass -p flag to interactively select cut frargment and crop area with mpv.
Show help for interactive mode:

  1. webm -hi

webm.py wiki contains some encoding
tricks and links to documentation on WebM/VPx.

License

webm.py is licensed under CC0.