-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is uploading a video supported? #761
Comments
Video upload support was added in #755. You need to be running master to get this though, it hasn't been back-ported to the stable branch. |
@jonmast Why only supports MP4 video file? There any way to send other formats? |
@narlei Twitter requires the video to be AAC encoded: https://dev.twitter.com/rest/media/uploading-media#videorecs |
fail trying to upload video with: Error creating status. (Twitter::Error::Forbidden) also fail: media type unrecognized also fail: Could not authenticate you. (Twitter::Error::Unauthorized) client.update('bing!') ok |
the same happen to me when i first try to uploading video my twitter account. however you’ll be getting error if the selected video is not in a supported format. Maximum file size is 512MB. and Maximum video length is 2 minutes and 20 seconds.) See here for more details about formats.) https://support.twitter.com/articles/20172128 and https://dev.twitter.com/rest/public/uploading-media |
Does anyone have a working example of how to upload a video using the chunked method using this gem? I've seen other examples using Bash, PHP, other libraries, etc, but nothing using this gem. |
I've tried several ways of uploading a small mp4 video. But I get the following error from twitter:
Twitter::Error::BadRequest: The validation of media ids failed.
I'm not sure if the gem supports chunked video uploading: https://dev.twitter.com/rest/public/uploading-media
I've tried using twurl, and it works with the same file, so I know it's not a size, length, width/height, aspect ratio problem.
The twurl command (after auth) is along the following:
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=INIT&media_type=video/mp4&total_bytes=113004
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=707438900436930561&segment_index=0" --file filename.mp4 --file-field "media"
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "command=FINALIZE&media_id=707438900436930561"
twurl "/1.1/statuses/update.json" -d "media_ids=707438900436930561&status=You get the point..."
Let me know if I'm missing something. Thanks!
The text was updated successfully, but these errors were encountered: