Skip to main content

django-video-encoder

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

Metadata

Release files for django-video-encoder 1.1.1

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

Source distribution (sdist)

Source distribution for django-video-encoder 1.1.1
File Size Uploaded
django_video_encoder-1.1.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-video-encoder 1.1.1
File Interpreter ABI Platform
django_video_encoder-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.0 kB

Release files / django_video_encoder-1.1.1.tar.gz

Download URL django_video_encoder-1.1.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ba008311d24a3c17570ac64c6571d0be15cd252c8aa29f14de1bcbc5390f3de4
BLAKE2b-256 checksum
How to use checksums
359dfebf3d00959409fe5de88d4511563c5a65ddd32a5e5b4e0a2b1a9447bc74
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / django_video_encoder-1.1.1-py3-none-any.whl

Download URL django_video_encoder-1.1.1-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d070f8fbdce2b521555dd541a43b97e7d4f0234aa5b4dc00eea55800e7bb10c4
BLAKE2b-256 checksum
How to use checksums
3eb21d9e13c68d5be303de37571148a0fef93946aba39cc797e4ca011d1f0076
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

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