Simple integration of a Django model with a FileField to encoding backends
Project description
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
Built Distribution
File details
Details for the file django_video_encoder-1.1.1.tar.gz
.
File metadata
- Download URL: django_video_encoder-1.1.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba008311d24a3c17570ac64c6571d0be15cd252c8aa29f14de1bcbc5390f3de4 |
|
MD5 | baa4032bfaeb6bee4563ed202ca50bbf |
|
BLAKE2b-256 | 359dfebf3d00959409fe5de88d4511563c5a65ddd32a5e5b4e0a2b1a9447bc74 |
File details
Details for the file django_video_encoder-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_video_encoder-1.1.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d070f8fbdce2b521555dd541a43b97e7d4f0234aa5b4dc00eea55800e7bb10c4 |
|
MD5 | 571a41f0d29d71c537a6aaa79e46b127 |
|
BLAKE2b-256 | 3eb21d9e13c68d5be303de37571148a0fef93946aba39cc797e4ca011d1f0076 |