Chunked Media API Inconsistent Behaviour for uploading video



I’m trying to publish video to using the API using TweetInvi library, and encountered the following behavior:

  1. Upload a video successfully using a web client (Chrome/FireFox) successfully
  2. Upload the same video using the REST API, with 1MB chunks - and failing - ‘unsupported media’
  3. Upload the same video using the web client again - timeout.

It happened multiple times, in a consistent way - regardless of video file size & encoding.
Once I stopped using the API - video uploads through the web client were successful.

I tried using fiddler to track differences - but couldn’t find any.




What is the duration / length of the video you are attempting? I am seeing some weird behavior too, and the pattern seems to be that videos uploaded via the API is recognized as having 2x the actual duration (so a 14 second video shows a 28 second duration). When playing back the video, it simply freeze-frames halfway through (when the actual video content ends).

Uploading the exact same video through the web client gets me the right duration and playback of the video, but any video over 15 seconds would be rejected through the API (as it wrongly detects it being 30+ seconds long).

As for the timeout, I have not experienced that.


It happened for all sorts of lengths, from 1 to 10 seconds - it fails on the API, and successful in the browser


We got some help from Twitter engineering team, and discovered that uploaded video:

  • Should use closed GOP
  • Should contain valid chapters/menus (in our case they were malformed)

Hope this helps someone.