4
4
A Python module for the [ Zencoder] ( http://zencoder.com ) API.
5
5
6
6
## Installation
7
- Install from PyPI using ` easy_install ` or ` pip ` .
7
+ Install from PyPI using ` pip ` .
8
8
9
9
pip install zencoder
10
10
@@ -13,19 +13,26 @@ Install from PyPI using `easy_install` or `pip`.
13
13
14
14
## Usage
15
15
16
+ ### Create an instance of ` Zencoder `
17
+
16
18
from zencoder import Zencoder
17
19
zen = Zencoder('abc123') # enter your api key
18
20
21
+ ### Submit a job
22
+
19
23
# creates an encoding job with the defaults
20
24
job = zen.job.create('http://input-file/movie.avi')
21
25
print job.code
22
26
print job.body
23
27
print job.body['id']
24
28
29
+ ### Return output progress
30
+
25
31
# get the transcode progress of the first output
26
32
progress = zen.output.progress(job.body['outputs'][0]['id'])
27
33
print progress.body
28
34
35
+ ### Create a new job with multiple outputs
29
36
30
37
# configure your outputs with dictionaries
31
38
iphone = {
@@ -39,11 +46,20 @@ Install from PyPI using `easy_install` or `pip`.
39
46
'url': 's3://output-bucket/output-file.vp8',
40
47
'video_codec':, 'vp8'
41
48
}
49
+
42
50
# the outputs kwarg requires an iterable
43
51
outputs = (iphone, web)
44
52
another_job = zen.job.create(input_url, outputs=outputs)
45
53
46
- ** Note:** If you set the ` ZENCODER_API_KEY ` environment variable to your api key, you don't have to provide it when initializing Zencoder.
54
+ ### ZENCODER_API_KEY Environment Variable
55
+
56
+ ``` python
57
+ import os
58
+ os.environ[' ZENCODER_API_KEY' ] = ' abcd1234'
59
+ zen = Zencoder()
60
+ ```
61
+
62
+ If you set ` ZENCODER_API_KEY ` to your API Key, you don't have to provide it when initializing Zencoder.
47
63
48
64
## Specifying the API Version
49
65
Set the version of the Zencoder API you want to use as the ` api_version ` keyword to the ` Zencoder ` object (defaults to ` v2 ` ):
0 commit comments