Skip to main content

Video Converter library

Project description

Video Converter is a Python 3 (>= 3.7) module for converting video files from one format and codec to another.

It uses the FFmpeg multimedia framework for actual file processing, and adds an easy-to-use API for probing and converting media files on top of it.

Quickstart

from converter import Converter
conv = Converter()

info = conv.probe('test/test1.avi')

convert = conv.convert('test/test1.avi', 'test/test1.mp4', {
    'format': 'mp4',
    'audio': {
        'codec': 'aac',
        'samplerate': 11025,
        'channels': 2
    },
    'video': {
        'codec': 'hevc',
        'width': 720,
        'height': 400,
        'fps': 25
    }})

for timecode in convert:
    print(f'\rConverting ({timecode:.2f}) ...')

Documentation and tests

There’s a fair amount of documentation in doc/ directory. To generate it from Sphinx sources, use:

python3.7 setup.py doc

and then visit doc/_build/html/index.html.

To run the automated tests:

python3.7 setup.py test

The test suite assumes you already have the required ffmpeg and ffprobe tools installed on your system.

Installation and requirements

To install the package:

python3.7 setup.py install

Note that this only installs the Python Video Converter library. The ffmpeg and ffprobe tools should be installed on the system separately, with all the codec and format support you require.

If you need to compile and install the tools manually, have a look at the example script test/install-ffmpeg.sh (used for automated test suite). It may or may not be useful for your requirements, so don’t just blindly run it - check that it does what you need first.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PythonVideoConverter-1.0.2.tar.gz (4.4 MB view details)

Uploaded Source

File details

Details for the file PythonVideoConverter-1.0.2.tar.gz.

File metadata

  • Download URL: PythonVideoConverter-1.0.2.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for PythonVideoConverter-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e8aeed9b61e06a9b1e174ac2eeb94e6c41df05cf1fecd93c1a050d2b661043ec
MD5 3d6fff4dc6a3971fcfc3cf50fab56050
BLAKE2b-256 8c4096f602359ed09002542fbd1edafb53bf394401aa0440b6b2c3a146bd3871

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page