Uploading video



I’m trying to upload a video with sync and async (chunked) apis, but in both cases I’m getting “media type unrecognized” error. I tried uploading mov and mp4 files. the mov files was recoded on my cellphone, and based on the documentation it should be compatible with Twitter API.
note that I’m using the same method to upload images and they are working file.


Can you provide links to example / sample files, and are you able to share more information on the data file format?


Hi Andy,

thanks for the reply, I still have the same problem. I can upload images and gifs, but when I’m trying to upload a video with the same code, I’m getting “media type unrecognized” error. I tried mp4 videos, different sizes and dimensions. also mov videos created by my iphone.

here is a link to one of the sample videos I was trying to upload.




Hi Andy,

Any thoughts on this?



Hi @andypiper , any thoughts on this? I’m still having this issue.



Hi, i’m having the same problem with my app.
It works fine with images and gif but it fails when i try to upload video.

@andypiper do you have news?

In my case i make a post to https://upload.twitter.com/1.1/media/upload.json and use the media_data parameter to send the base64 encoded file.


Have you tried our large video upload sample?


My video test size es arround 10 mb.


Is the sample app able to upload the same file? Trying to eliminate differences in the way the API is being called.


I can upload images and gif without any problems.

This is a response:
HttpResponseProxy{HTTP/1.1 400 Bad Request [cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0, content-disposition: attachment; filename=json.json, content-type: application/json;charset=utf-8, date: Tue, 07 Feb 2017 18:47:19 GMT, expires: Tue, 31 Mar 1981 05:00:00 GMT, last-modified: Tue, 07 Feb 2017 18:47:19 GMT, pragma: no-cache, server: tsa_d, status: 400 Bad Request, strict-transport-security: max-age=631138519, vary: Origin, x-access-level: read-write-directmessages, x-connection-hash: 494626923301bf57bd4d6e0c82b2cc56, x-frame-options: SAMEORIGIN, x-rate-limit-limit: 415, x-rate-limit-remaining: 412, x-rate-limit-reset: 1486496058, x-response-time: 339, x-transaction: 005055d400ba2c97, x-tsa-request-body-time: 4525, x-twitter-response-tags: BouncerCompliant, x-xss-protection: 1; mode=block] org.apache.http.client.entity.DecompressingEntity@7e1fa8a4}
This is my video:



@andypiper I tried the python code, but I’m getting “bad authentication data” error message. I checked and double checked api key and token.

also I tied different MP4 video files with my code (smaller than 5 MB and bigger) the same code that uploads images and gifs successfully is returning “media type unrecognized” for mp4 videos. is there a specific type of video we should upload?



I tried uploading both of your files but I’m seeing a “media type unrecognized” error. Unfortunately I’m not enough of an expert in video file formats to spot what the issue is with them, though. I used ffprobe and a couple of other tools to inspect it but couldn’t spot a specific issue.

The video format recommendations are here -> https://dev.twitter.com/rest/media/uploading-media#videorecs


can you provide me a video that dont fails?


I used my videos on twitter.com and i could upload them without any problems.
Chunked method documentation is not enough or confusing.

Problems Uploading Videos - media type unrecognized

@andypiper I tweeted a video in twitter website.


— Arbi Stepanian (@rb_stepanian) February 8, 2017

then I downloaded the video from the following link:

and tried to upload it using my code (which uploads images and gifs perfectly) but still got the media type unrecognized error.



@rb_stepanian going back to the first video you provided, it looks like the issue there is that it has 5.1 audio and we only support mono or stereo with the tweet_video format. We will try to improve the error reporting in the future.

@MartinRazzo at present I’m not aware of what the issue may be with your file.


thanks @andypiper. how about the second video? I uploaded that video to twitter in a tweet using the website, then downloaded it and tried to upload it using the API and got the same error.