Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload video on twitter

I have to upload a video on twitter from android app. I have successfully uploaded image and text on twitter. I am using the twitter4j-core-3.0.3.jar library.

I tried uploading video using the same method I used for images, but failed to upload and got exception code 403 and TwitterException {exceptionCode=[2ea3c142-58dea759], statusCode=403, message=Error creating status., code=189, retryAfter=-1, rateLimitStatus=null, version=3.0.3}.

I also downloaded twitvid sdk from http://twitvid.pbworks.com/w/page/22556292/Client%20Libraries, but even after integrating this sdk, I could not upload video on twitter.

As per twitter official discusion thread https://dev.twitter.com/discussions/11241 we can upload video using twitvid using that code.

Since I am not having a suitable sdk, I am not able to work on this. Any help to upload video on twitter from android app will be highly appreciated.

like image 845
seema Avatar asked Dec 19 '13 12:12

seema


People also ask

Why can't I upload a video to Twitter?

If the video file doesn't meet Twitter video posting requirements, for example, the video is too long, the file size is too large, or the video format is not supported, you will end up with failure in posting a video to Twitter. According to Twitter's official policy, the video length could be between 0.5s to 140s.

Can I upload 3 minute video on Twitter?

By default, you can only upload videos up to 140 seconds long, or 2 minutes and 20 seconds. You can bypass this by setting up a Twitter ad account for free. You only need to provide your bank card details.

What is the maximum size of video upload on Twitter?

The maximum file size for videos on Twitter is 512MB.

What video files can you upload to Twitter?

If Twitter says video can not be processed while uploading, it is likely due to an unsupported format or codec. Twitter supports MP4 and MOV videos with H. 264 encoding and AAC audio. It does not accept other video formats like MKV, AVI, FLV, or WebM.


1 Answers

EDIT 2016: This answer is outdated. Twitter now support video upload in addition to linking.

You cannot upload video directly to Twitter - they simply don't support it.

Here's what you have to do, instead.

  1. Upload the video to a 3rd party service (like YouTube)
  2. Get the public URL of the uploaded video
  3. Add the URL to the status you send to Twitter - e.g. "Here is my video http://example.com/video123"

If you want, you can add a thumbnail of the video as an image attachment.

like image 85
Terence Eden Avatar answered Oct 05 '22 22:10

Terence Eden