{ "info": { "author": "Alexander Frenzel", "author_email": "alex@relatedworks.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=====================\ndjango-video-encoding\n=====================\n\n\n.. image:: https://img.shields.io/pypi/v/django-video-encoding.svg\n :target: https://pypi.python.org/pypi/django-video-encoding\n\n.. image:: https://travis-ci.org/escaped/django-video-encoding.png?branch=master\n :target: http://travis-ci.org/escaped/django-video-encoding\n :alt: Build Status\n\n.. image:: https://coveralls.io/repos/github/escaped/django-video-encoding/badge.svg?branch=master\n :target: https://coveralls.io/github/escaped/django-video-encoding?branch=master\n :alt: Coverage\n\n.. image:: https://img.shields.io/pypi/pyversions/django-video-encoding.svg\n\n.. image:: https://img.shields.io/pypi/status/django-video-encoding.svg\n\n.. image:: https://img.shields.io/pypi/l/django-video-encoding.svg\n\n\ndjango-video-encoding helps to convert your videos into different formats and resolutions.\n\n\n\nInstallation\n============\n\n#. Install django-video-encoding ::\n\n pip install django-video-encoding\n\n#. Add ``video_encoding`` to your ``INSTALLED_APPS``.\n\n\n\nIntegration\n===========\n\nAdd a ``VideoField`` and a ``GenericRelation(Format)`` to your model.\nYou can optionally store the ``width``, ``height`` and ``duration`` of the video\nby supplying the corresponding field names to the ``VideoField``. ::\n\n from django.contrib.contenttypes.fields import GenericRelation\n from django.db import models\n from video_encoding.fields import VideoField\n from video_encoding.models import Format\n\n\n class Video(models.Model):\n width = models.PositiveIntegerField(editable=False, null=True)\n height = models.PositiveIntegerField(editable=False, null=True)\n duration = models.FloatField(editable=False, null=True)\n\n file = VideoField(width_field='width', height_field='height',\n duration_field='duration')\n\n format_set = GenericRelation(Format)\n\n\nTo show all converted videos in the admin, you should add the ``FormatInline``\nto your ``ModelAdmin`` ::\n\n from django.contrib import admin\n from video_encoding.admin import FormatInline\n\n from .models import Video\n\n\n @admin.register(Video)\n class VideoAdmin(admin.ModelAdmin):\n inlines = (FormatInline,)\n\n list_dispaly = ('get_filename', 'width', 'height', 'duration')\n fields = ('file', 'width', 'height', 'duration')\n readonly_fields = fields\n\n\nThe conversion of the video should be done in a separate process. Typical\noptions are django-rq_ or celery_. We will use ``django-rq`` in the\nfollowing example. The configuration for ``celery`` is similar.\n``django-video-encoding`` already provides a task (``convert_all_videos``)\nfor converting all videos on a model.\nThis task should be triggered when a video was uploaded. Hence we listen to\nthe ``post-save`` signal and enqueue the saved instance for processing. ::\n\n # signals.py\n from django.db.models.signals import post_save\n from django.dispatch import receiver\n from django_rq import enqueue\n\n from video_encoding import tasks\n\n from .models import Video\n\n\n @receiver(post_save, sender=Video)\n def convert_video(sender, instance, **kwargs):\n enqueue(tasks.convert_all_videos,\n instance._meta.app_label,\n instance._meta.model_name,\n instance.pk)\n\nAfter a while You can access the converted videos using ::\n\n video = Video.objects.get(...)\n for format in video.format_set.complete().all():\n # do something\n\n.. _django-rq: https://github.com/ui/django-rq\n.. _celery: http://www.celeryproject.org/\n\n\n\nConfiguration\n=============\n\n**VIDEO_ENCODING_THREADS** (default: ``1``)\nDefines how many threads should be used for encoding. This may not be supported\nby every backend.\n\n**VIDEO_ENCODING_BACKEND** (default: ``'video_encoding.backends.ffmpeg.FFmpegBackend'``)\nChoose the backend for encoding. ``django-video-encoding`` only supports ``ffmpeg``,\nbut you can implement your own backend. Feel free to pulish your plugin and\nsubmit a pull request.\n\n**VIDEO_ENCODING_BACKEND_PARAMS** (default: ``{}``)\nIf your backend requires some special configuration, you can specify them here\nas ``dict``.\n\n**VIDEO_ENCODING_FORMATS** (for defaults see ``video_encoding/config.py``)\nThis dictionary defines all required encodings and has some resonable defaults.\nIf you want to customize the formats, you have to specify ``name``,\n``extension`` and ``params`` for each format. For example ::\n\n VIDEO_ENCODING_FORMATS = {\n 'FFmpeg': [\n {\n 'name': 'webm_sd',\n 'extension': 'webm',\n 'params': [\n '-b:v', '1000k', '-maxrate', '1000k', '-bufsize', '2000k',\n '-codec:v', 'libvpx', '-r', '30',\n '-vf', 'scale=-1:480', '-qmin', '10', '-qmax', '42',\n '-codec:a', 'libvorbis', '-b:a', '128k', '-f', 'webm',\n ],\n },\n ]\n\n\nEncoding Backends\n=================\n\nvideo_encoding.backends.ffmpeg.FFmpegBackend (default)\n------------------------------------------------------\nBackend for using ``ffmpeg`` and ``ffprobe`` to convert your videos.\n\nOptions\n.......\n\n**VIDEO_ENCODING_FFMPEG_PATH**\nPath to ``ffmpeg``. If no path is provided, the backend uses ``which`` to\nlocate it.\n**VIDEO_ENCODING_FFPROBE_PATH**\nPath to ``ffprobe``. If no path is provided, the backend uses ``which`` to\nlocate it.\n\n\nCustom Backend\n--------------\n\nYou can implement a custom encoding backend. Create a new class which inherits\nfrom ``video_encoding.backends.base.BaseEncodingBackend``. You must set the\nproperty ``name`` and implement the methods ``encode``, ``get_media_info`` and\n``get_thumbnail``. For further details see the reference implementation:\n``video_encoding.backends.ffmpeg.FFmpegBackend``.\n\n\nIf you want to open source your backend, follow these steps.\n\n1. create a packages named django-video-encoding-BACKENDNAME\n2. publish your package to pypi_\n3. Submit a pull requests with the following changes:\n\n * add the package to ``extra_requires``\n * provide reasonable defaults for ``VIDEO_ENCODING_FORMATS``\n\n.. _pypi: https://pypi.python.org/pypi\n\n\nDevelopment\n===========\n\nThis project is using `poetry `_ to manage all\ndev dependencies.\nClone this repository and run ::\n\n poetry develop\n\n\nto create a virtual enviroment with all dependencies.\nYou can now run the test suite using ::\n\n poetry run pytest\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/escaped/django-video-encoding", "keywords": "", "license": "BSD-3-Clause", "maintainer": "Alexander Frenzel", "maintainer_email": "alex@relatedworks.com", "name": "django-video-encoding", "package_url": "https://pypi.org/project/django-video-encoding/", "platform": "", "project_url": "https://pypi.org/project/django-video-encoding/", "project_urls": { "Documentation": "https://github.com/escaped/django-video-encoding/blob/master/README.rst", "Homepage": "https://github.com/escaped/django-video-encoding", "Repository": "https://github.com/escaped/django-video-encoding" }, "release_url": "https://pypi.org/project/django-video-encoding/0.4.0/", "requires_dist": [ "django-appconf (>=1.0,<2.0)", "shutilwhich (>=1.1,<2.0)", "pillow (>=5.0,<6.0)", "six (>=1.6,<2.0)" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "django-video-encoding helps to convert your videos into different formats and resolutions.", "version": "0.4.0" }, "last_serial": 4561323, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d6329198c12502006cec0d2591bdc220", "sha256": "94877ba8fb0f66a947664c74d2834e787d62e4c747fb274201687ce136d951a1" }, "downloads": -1, "filename": "django_video_encoding-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d6329198c12502006cec0d2591bdc220", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 16385, "upload_time": "2017-04-24T11:50:01", "url": "https://files.pythonhosted.org/packages/62/10/3fe4b4582bd9ea4a50745c582fd35cf17798bb5c51921bed9ae21d18a3ab/django_video_encoding-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8b65e3d44d071e2d200fe83a9c2cf129", "sha256": "ea7e66732ee8bae23902913ded39028eecca1e1a2edb7791990f0a3ed7f6880c" }, "downloads": -1, "filename": "django-video-encoding-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8b65e3d44d071e2d200fe83a9c2cf129", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12174, "upload_time": "2017-04-24T11:49:59", "url": "https://files.pythonhosted.org/packages/00/e5/ec351a673ba87cef01d5b65f540e72e8342d1e61ca230716b78f116df94f/django-video-encoding-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a3362d9e03751e61594669106f0d6a61", "sha256": "99f54c48d57f3ae0a0ce43f2eb1ae27327a10b6ae556881ccd93d6d163d473c8" }, "downloads": -1, "filename": "django_video_encoding-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3362d9e03751e61594669106f0d6a61", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 16539, "upload_time": "2018-01-21T17:14:11", "url": "https://files.pythonhosted.org/packages/45/d4/b14a2ffa85d81c26ed12eb8e37344f23ea45d26f2bd32dc63d724ca57ed1/django_video_encoding-0.2.0-py2.py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "6fc64c8e2da399d897779588adf56773", "sha256": "ce20b8c44b99a20ed3d2c5813ad26e9961e5bb8f2bd37f21144a3acd27e1b8a1" }, "downloads": -1, "filename": "django_video_encoding-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6fc64c8e2da399d897779588adf56773", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 28533, "upload_time": "2018-11-16T00:43:47", "url": "https://files.pythonhosted.org/packages/36/92/56ef2586bcee52482d65b9f6945bf6b38357d431ac20bd34a797b7d96762/django_video_encoding-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "04fdc1311643dd620f3a59756443e423", "sha256": "aca05aeb9e292a64831e61687905cc4b3a896ed534414bc0e388b4a15c0ae296" }, "downloads": -1, "filename": "django-video-encoding-0.3.0.tar.gz", "has_sig": false, "md5_digest": "04fdc1311643dd620f3a59756443e423", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 12549, "upload_time": "2018-11-16T00:43:44", "url": "https://files.pythonhosted.org/packages/ac/54/70c8417d028e1d576903ac0e267103739a26e2e90807dc8b8a19bd996355/django-video-encoding-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "6f1f57284d4cde3d743222aa82f6d275", "sha256": "2ed0f60ff7b9c6df701ee02ffe385d9ea628512c8efa090d388612718e6dd6f9" }, "downloads": -1, "filename": "django_video_encoding-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6f1f57284d4cde3d743222aa82f6d275", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 30811, "upload_time": "2018-11-16T00:50:43", "url": "https://files.pythonhosted.org/packages/32/48/36f20e0857933d6ec3a9813cb74df8450b48f0069aff8bd5bce26a4c0a79/django_video_encoding-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "182c4bfa5ad6b352f5a3dd0e37da4a9f", "sha256": "aca2cc25a8143c400487d9d21fe86f78c67f05bf93a582fad5b25b50b5021940" }, "downloads": -1, "filename": "django-video-encoding-0.3.1.tar.gz", "has_sig": false, "md5_digest": "182c4bfa5ad6b352f5a3dd0e37da4a9f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 12964, "upload_time": "2018-11-16T00:50:41", "url": "https://files.pythonhosted.org/packages/1f/aa/139607a8172d02e6a90697fd2100c2affd703a1acc37b41ea4414117393a/django-video-encoding-0.3.1.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "098096e9481edbfcfc426bf3b42c2a97", "sha256": "7d430d77291628095fe94a1dff42b9f043e34e6258eab04f705981ec4d99ce2b" }, "downloads": -1, "filename": "django_video_encoding-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "098096e9481edbfcfc426bf3b42c2a97", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 31404, "upload_time": "2018-12-04T21:56:42", "url": "https://files.pythonhosted.org/packages/0c/00/671b23ed5485ead8b5a09d0488a5a51bcbcf22bbbb2eea350e6c458d6736/django_video_encoding-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8fe30c5ce35adefa31714b6d3578b31c", "sha256": "c5b5fd8ea25e868d0cd056bfc63b9018e75f17bf01c5cc1ed0de5551365d7eb3" }, "downloads": -1, "filename": "django-video-encoding-0.4.0.tar.gz", "has_sig": false, "md5_digest": "8fe30c5ce35adefa31714b6d3578b31c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 13136, "upload_time": "2018-12-04T21:56:40", "url": "https://files.pythonhosted.org/packages/c3/7e/088ab12422bab6d8bf8d0042f3ea3cfe12e1a0c02b591d88984cfa30f662/django-video-encoding-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "098096e9481edbfcfc426bf3b42c2a97", "sha256": "7d430d77291628095fe94a1dff42b9f043e34e6258eab04f705981ec4d99ce2b" }, "downloads": -1, "filename": "django_video_encoding-0.4.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "098096e9481edbfcfc426bf3b42c2a97", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 31404, "upload_time": "2018-12-04T21:56:42", "url": "https://files.pythonhosted.org/packages/0c/00/671b23ed5485ead8b5a09d0488a5a51bcbcf22bbbb2eea350e6c458d6736/django_video_encoding-0.4.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8fe30c5ce35adefa31714b6d3578b31c", "sha256": "c5b5fd8ea25e868d0cd056bfc63b9018e75f17bf01c5cc1ed0de5551365d7eb3" }, "downloads": -1, "filename": "django-video-encoding-0.4.0.tar.gz", "has_sig": false, "md5_digest": "8fe30c5ce35adefa31714b6d3578b31c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 13136, "upload_time": "2018-12-04T21:56:40", "url": "https://files.pythonhosted.org/packages/c3/7e/088ab12422bab6d8bf8d0042f3ea3cfe12e1a0c02b591d88984cfa30f662/django-video-encoding-0.4.0.tar.gz" } ] }