Django + AWS Elastic Transcoder

Overview

Django Elastic Transcoder

Build Status Coverage Status

django-elastic-transcoder is an Django app, let you integrate AWS Elastic Transcoder in Django easily.

What is provided in this package?

  • Transcoder class
  • URL endpoint for receive SNS notification
  • Signals for PROGRESS, ERROR, COMPLETE
  • EncodeJob model

Workflow

https://github.com/StreetVoice/django-elastic-transcoder/blob/master/docs/images/workflow.jpg

Install

First, install dj_elastictranscode with pip

$ pip install django-elastic-transcoder

Then, add dj_elastictranscoder to INSTALLED_APPS

INSTALLED_APPS = (
    ...
    'dj_elastictranscoder',
    ...
)

Bind urls.py

urlpatterns = patterns('',
    ...
    url(r'^dj_elastictranscoder/', include('dj_elastictranscoder.urls')),
    ...
)

Migrate

$ ./manage.py migrate

Setting up AWS Elastic Transcoder

  1. Create a new Pipeline in AWS Elastic Transcoder.
  2. Hookup every Notification.
  3. Subscribe SNS Notification through HTTP
  4. You are ready to encode!

Required Django settings

Please settings up variables below to make this app works.

AWS_ACCESS_KEY_ID = <your aws access key id>
AWS_SECRET_ACCESS_KEY = <your aws secret access key>
AWS_REGION = <aws region>

Usage

For instance, encode an mp3

from dj_elastictranscoder.transcoder import Transcoder

input = {
    'Key': 'path/to/input.mp3',
}

outputs = [{
    'Key': 'path/to/output.mp3',
    'PresetId': '1351620000001-300040' # for example: 128k mp3 audio preset
}]

pipeline_id = '<pipeline_id>'

transcoder = Transcoder(pipeline_id)
transcoder.encode(input, outputs)

# your can also create a EncodeJob for object automatically
transcoder.create_job_for_object(obj)


# Transcoder can also work standalone without Django
# just pass region and required aws key/secret to Transcoder, when initiate

transcoder = Transcoder(pipeline_id, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)

Setting Up AWS SNS endpoint

AWS Elastic Transcoder can send various SNS notification to notify your application, like PROGRESS, ERROR, WARNING and COMPLETE

So this package provide a endpoint to receieve these notifications, for you to update transcode progress. without checking by your self.

Go to SNS section in AWS WebConsole to choose topic and subscribe with the url below.

http://<your-domain>/dj_elastictranscoder/endpoint/

Before notification get started to work, you have to activate SNS subscription, you will receive email with activation link.

After subscribe is done, you will receive SNS notification.

Signals

This package provide various signals for you to get notification, and do more things in your application. you can check the signals usage in tests.py for more usage example.

  • transcode_onprogress
  • transcode_onerror
  • transcode_oncomplete
Owner
StreetVoice
StreetVoice
Automatic class scheduler for Texas A&M written with Python+Django and React+Typescript

Rev Registration Description Rev Registration is an automatic class scheduler for Texas A&M, aimed at easing the process of course registration by gen

Aggie Coding Club 21 Nov 15, 2022
Awesome Django Markdown Editor, supported for Bootstrap & Semantic-UI

martor Martor is a Markdown Editor plugin for Django, supported for Bootstrap & Semantic-UI. Features Live Preview Integrated with Ace Editor Supporte

659 Jan 04, 2023
Django/Jinja template indenter

DjHTML A pure-Python Django/Jinja template indenter without dependencies. DjHTML is a fully automatic template indenter that works with mixed HTML/CSS

Return to the Source 378 Jan 01, 2023
Plug and play continuous integration with django and jenkins

django-jenkins Plug and play continuous integration with Django and Jenkins Installation From PyPI: $ pip install django-jenkins Or by downloading th

Mikhail Podgurskiy 941 Oct 22, 2022
MAC address Model Field & Form Field for Django apps

django-macaddress MAC Address model and form fields for Django We use netaddr to parse and validate the MAC address. The tests aren't complete yet. Pa

49 Sep 04, 2022
Built from scratch to replicate some of the Django admin functionality and add some more, to serve as an introspective interface for Django and Mongo.

django-mongonaut Info: An introspective interface for Django and MongoDB. Version: 0.2.21 Maintainer: Jazzband (jazzband.co) This Project is Being Mov

Jazzband 238 Dec 26, 2022
Py-instant-search-redis - Source code example for how to build an instant search with redis in python

py-instant-search-redis Source code example for how to build an instant search (

Giap Le 4 Feb 17, 2022
This is a personal django website for forum posts

Django Web Forum This is a personal django website for forum posts It includes login, registration and forum posts with date time. Tech / Framework us

5 May 12, 2022
RedisTimeSeries python client

redistimeseries-py Deprecation notice As of redis-py 4.0.0 this library is deprecated. It's features have been merged into redis-py. Please either ins

98 Dec 08, 2022
Store events and publish to Kafka

Create an event from Django ORM object model, store the event into the database and also publish it into Kafka cluster.

Diag 6 Nov 30, 2022
Django-shared-app-isolated-databases-example - Django - Shared App & Isolated Databases

Django - Shared App & Isolated Databases An app that demonstrates the implementa

Ajai Danial 5 Jun 27, 2022
Adding Firebase Cloud Messaging Service into a Django Project

Adding Firebase Cloud Messaging Service into a Django Project The aim of this repository is to provide a step-by-step guide and a basic project sample

Seyyed Ali Ayati 11 Jan 03, 2023
A standalone package to scrape financial data from listed Vietnamese companies via Vietstock

Scrape Financial Data of Vietnamese Listed Companies - Version 2 A standalone package to scrape financial data from listed Vietnamese companies via Vi

Viet Anh (Vincent) Tran 45 Nov 16, 2022
Indonesia's negative news detection using gaussian naive bayes with Django+Scikir Learn

Introduction Indonesia's negative news detection using gaussian naive bayes build with Django and Scikit Learn. There is also any features, are: Input

Harifzi Ham 1 Dec 30, 2021
Use heroicons in your Django and Jinja templates.

heroicons Use heroicons in your Django and Jinja templates. Requirements Python 3.6 to 3.9 supported. Django 2.2 to 3.2 supported. Are your tests slow

Adam Johnson 52 Dec 14, 2022
DCM is a set of tools that helps you to keep your data in your Django Models consistent.

Django Consistency Model DCM is a set of tools that helps you to keep your data in your Django Models consistent. Motivation You have a lot of legacy

Occipital 59 Dec 21, 2022
A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.

django-versatileimagefield A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for creat

Jonathan Ellenberger 490 Dec 13, 2022
PEP-484 type hints bindings for the Django web framework

mypy-django Type stubs to use the mypy static type-checker with your Django projects This project includes the PEP-484 compatible "type stubs" for Dja

Machinalis 223 Jun 17, 2022
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. An example o

pytest-dev 9.6k Jan 06, 2023
A prettier way to see Django requests while developing

A prettier way to see Django requests while developing

Adam Hill 35 Dec 02, 2022