Skip to content

Commit 2d21b57

Browse files
author
Alex Schworer
committed
Merge branch 'readme-docs' of https://github.com/zencoder/zencoder-py into readme-docs
Conflicts: README.md
2 parents b924541 + a1728bd commit 2d21b57

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

README.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
12
Zencoder
2-
----
3+
--------
34

45
[![Build Status](https://travis-ci.org/zencoder/zencoder-py.png?branch=master)](https://travis-ci.org/zencoder/zencoder-py)
56

@@ -16,6 +17,55 @@ Import zencoder
1617
```python
1718
from zencoder import Zencoder
1819
```
20+
=======
21+
### Create an instance of `Zencoder`
22+
23+
from zencoder import Zencoder
24+
zen = Zencoder('abc123') # enter your api key
25+
26+
### Submit a job
27+
28+
# creates an encoding job with the defaults
29+
job = zen.job.create('http://input-file/movie.avi')
30+
print job.code
31+
print job.body
32+
print job.body['id']
33+
34+
### Return output progress
35+
36+
# get the transcode progress of the first output
37+
progress = zen.output.progress(job.body['outputs'][0]['id'])
38+
print progress.body
39+
40+
### Create a new job with multiple outputs
41+
42+
# configure your outputs with dictionaries
43+
iphone = {
44+
'label': 'iPhone',
45+
'url': 's3://output-bucket/output-file-1.mp4',
46+
'width': 480,
47+
'height': 320
48+
}
49+
web = {
50+
'label': 'web',
51+
'url': 's3://output-bucket/output-file.vp8',
52+
'video_codec':, 'vp8'
53+
}
54+
55+
# the outputs kwarg requires an iterable
56+
outputs = (iphone, web)
57+
another_job = zen.job.create(input_url, outputs=outputs)
58+
59+
### ZENCODER_API_KEY Environment Variable
60+
61+
```python
62+
import os
63+
os.environ['ZENCODER_API_KEY'] = 'abcd1234'
64+
zen = Zencoder()
65+
```
66+
67+
If you set `ZENCODER_API_KEY` to your API Key, you don't have to provide it when initializing Zencoder.
68+
>>>>>>> a1728bd03ce089174715cf2e83ea6ead7e13a405
1969
2070
Create an instance of the Zencoder client. This will accept an API key and version. If not API key is set, it will look for a `ZENCODER_API_KEY` environment variable. API version defaults to 'v2'.
2171

0 commit comments

Comments
 (0)