Skip to main content

Simple integration of a Django model with a FileField to encoding backends

Project description

https://img.shields.io/pypi/v/django-video-encoder.svg https://img.shields.io/pypi/pyversions/django-video-encoder.svg PyPI - Django Version

Simple integration with video encoding backends.

For now only the remote zencoder.com is supported.

Upload videos and asynchronously store the encoded videos and the generated thumbnails.

Requirements

Django 2.2+ and Celery to asynchronously run the encoding tasks.

Usage

You will need to add the following to your django settings:

  • Add django_video_encoder to INSTALLED_APPS

  • Add generic relation fields to your video models

    formats = GenericRelation(Format)
    thumbnails = GenericRelation(Thumbnail)
  • Set the DJANGO_VIDEO_ENCODER_THUMBNAIL_INTERVAL

  • Add the desired formats, for example

    DJANGO_VIDEO_ENCODER_FORMATS = {
        "H264 (HD)": {"video_codec": "h264"},  # full resolution if not specified
        "H264": {"video_codec": "h264", "width": 720, "height": 404},
        "VP9 (HD)": {"video_codec": "vp9"},
        "VP9": {"video_codec": "vp9", "width": 720, "height": 404},
    }

And specific settings using the zencoder backend:

  • Add ZENCODER_API_KEY and ZENCODER_NOTIFICATION_SECRET

  • You may also specify ZENCODER_REGION (default: europe) to the most suitable for you

DJANGO_VIDEO_ENCODER_FORMATS is a dictionary of {format_label: format_kwargs} where format_kwargs is a dictionary requiring video_codec and where all arguments are added to the encoding job POST. You can define width, height and much more see the Zencoder API.

Tests

Run tests with tox

Misc

To not be confused with the archived theonion/django-zencoder which is installed as zencoder

See also similar project escaped/django-video-encoding

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

django_video_encoder-1.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

django_video_encoder-1.1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file django_video_encoder-1.1.0.tar.gz.

File metadata

  • Download URL: django_video_encoder-1.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for django_video_encoder-1.1.0.tar.gz
Algorithm Hash digest
SHA256 54f9fdd89d80917fb022657e69701e40310d4e155b1ca9f4d9b4cdd5adae018b
MD5 da73bda24d37a3d5ed61f04d3a0e306a
BLAKE2b-256 6eadd89ad53f0935b1d43bf10564e1eed73619edad7d934cfa917d132c708ef0

See more details on using hashes here.

File details

Details for the file django_video_encoder-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_video_encoder-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.9.0

File hashes

Hashes for django_video_encoder-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6015c8e998353b33c4c78b0362ad2f9b02b11982433f5d0a106786e986e1bc9e
MD5 75adb3a44de6397f3a38380dd5fe65e5
BLAKE2b-256 875a818d55c0148d032f0550856fa61f8c7b58c6414098c08865082af9efd044

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