|
| 1 | +django-elastic-transcoder |
| 2 | +========================= |
| 3 | + |
| 4 | +|Build Status| |Coverage Status| |
| 5 | + |
| 6 | +Django + AWS Elastic Transcoder |
| 7 | + |
| 8 | +Install |
| 9 | +------- |
| 10 | + |
| 11 | +First, install ``dj_elastictranscode`` with ``pip`` |
| 12 | + |
| 13 | +.. code:: sh |
| 14 | +
|
| 15 | + $ pip install django-elastic-transcoder |
| 16 | +
|
| 17 | +Then, add ``dj_elastictranscoder`` to ``INSTALLED_APPS`` |
| 18 | + |
| 19 | +.. code:: python |
| 20 | +
|
| 21 | + INSTALLED_APPS = ( |
| 22 | + ... |
| 23 | + 'dj_elastictranscoder', |
| 24 | + ... |
| 25 | + ) |
| 26 | +
|
| 27 | +Bind ``urls.py`` |
| 28 | + |
| 29 | +.. code:: python |
| 30 | +
|
| 31 | + urlpatterns = patterns('', |
| 32 | + ... |
| 33 | + url(r'^dj_elastictranscoder/', include('dj_elastictranscoder.urls')), |
| 34 | + ... |
| 35 | + ) |
| 36 | +
|
| 37 | +Migrate |
| 38 | + |
| 39 | +.. code:: sh |
| 40 | +
|
| 41 | + $ ./manage.py migrate |
| 42 | +
|
| 43 | +Setting up AWS Elastic Transcoder |
| 44 | +--------------------------------- |
| 45 | + |
| 46 | +1. Create a new ``Pipeline`` in AWS Elastic Transcoder. |
| 47 | +2. Hookup every Notification. |
| 48 | +3. Subscribe SNS Notification through HTTP |
| 49 | +4. You are ready to encode! |
| 50 | + |
| 51 | +Usage |
| 52 | +----- |
| 53 | + |
| 54 | +For instance, encode an mp3 |
| 55 | + |
| 56 | +.. code:: python |
| 57 | +
|
| 58 | + from dj_elastictranscoder.transcoder import Transcoder |
| 59 | +
|
| 60 | + input = { |
| 61 | + 'Key': 'path/to/input.mp3', |
| 62 | + } |
| 63 | +
|
| 64 | + outputs = [{ |
| 65 | + 'Key': 'path/to/output.mp3', |
| 66 | + 'PresetId': '1351620000001-300040' # for example: 128k mp3 audio preset |
| 67 | + }] |
| 68 | +
|
| 69 | + pipeline_id = '<pipeline_id>' |
| 70 | +
|
| 71 | + transcoder = Transcoder(pipeline_id, 'ap-southeast-1') |
| 72 | + transcoder.encode(input, outputs) |
| 73 | +
|
| 74 | +.. |Build Status| image:: https://travis-ci.org/StreetVoice/django-elastic-transcoder.png?branch=master |
| 75 | + :target: https://travis-ci.org/StreetVoice/django-elastic-transcoder |
| 76 | +.. |Coverage Status| image:: https://coveralls.io/repos/StreetVoice/django-elastic-transcoder/badge.png?branch=master |
| 77 | + :target: https://coveralls.io/r/StreetVoice/django-elastic-transcoder?branch=master |
0 commit comments