Uploading video

media-upload
api

#1

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.


#2

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


#3

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.

http://www.socialiner.com/UserAssets/b19aaf71-041a-40de-9abf-47eb02b9a8c2/Assets/44522b6c-81fd-49a7-a7fd-4201504c2455.mp4

thanks,
Arbi


#4

Hi Andy,

Any thoughts on this?

thanks,
Arbi


#5

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

thanks,
Arbi


#6

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.


#7

Have you tried our large video upload sample?


#8

My video test size es arround 10 mb.


#9

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


#10

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:

https://drive.google.com/file/d/0B5BtJsJAFnUbZVhYenYxRkp3ZEE/view?usp=sharing


#11

@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?

thanks,
Arbi


#12

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


#13

can you provide me a video that dont fails?


#14

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
#15

@andypiper I tweeted a video in twitter website.

pic.twitter.com/e079p0Q9rE

— 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.

thanks,
Arbi


#16

@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.


#17

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.