Added gallery screenshot and improved README.md
[video-tweet.git] / README.md
1 # Large Video Upload
2
3 This Python sample demonstrates the following process of uploading large video files asynchronously with the Twitter API.
4
5 1. **INIT** media upload.
6 2. **APPEND** chunked data.
7 3. **FINALIZE** media uploaded.
8 4. Check **STATUS** of video processing.
9 5. Tweet with attached video.
10
11 Large video files are longer than 30 seconds up to 140 seconds, and/or a file size larger than 15 megabytes up to 512 megabytes.
12
13 [Learn more](https://dev.twitter.com/rest/media) about the Twitter Media APIs. Pay attention to the other requirements such as encoding, frame size and video formats supported.
14
15 ## Running the sample
16
17 1. Install requirements:
18
19 ```
20 $ pip install -r requirements.txt
21 ```
22
23 2. Fill in your [consumer keys and access tokens](https://apps.twitter.com) in `async-upload.py`:
24
25 ```
26 CONSUMER_KEY = 'your-consumer-key'
27 CONSUMER_SECRET = 'your-consumer-secret'
28 ACCESS_TOKEN = 'your-access-token'
29 ACCESS_TOKEN_SECRET = 'your-access-secret'
30 ```
31
32 3. Edit path to your video file in `async-upload.py`:
33
34 ```
35 VIDEO_FILENAME = 'path/to/video/file'
36 ```
37
38 4. Run script:
39
40 ```
41 $ python async-upload.py
42 ```
43
44 Questions? Check our [developer discussion forums](https://https://twittercommunity.com/c/media-apis).