But the comment, “keeping videos shorter than 30s”, contradicts the announcement for 140 second video support in the Media API by @joncipriano. The link you provided to the Reference for Media API clearly states the 140 second support as well.
I actually get the same exact error above as @programmertool using async method with Media API and only if the video file is greater than 30 seconds in duration. Technically, there is no error returned as promised by the API but the urlResponse code is a 400 and the response data has the “Duration too long, maximum:30000” message. The log below includes the message as well as the failed MediaID: 750564825571426304. Any idea what I might be doing wrong?
[3337:2915720] Twitter Stage1 HTTP Response: 202, responseData: {"media_id":750564825571426304,"media_id_string":"750564825571426304","expires_after_secs":86400}
[3337:2915720] chunk index -> 1, data size -> 5000000 bytes
[3337:2915720] chunk index -> 2, data size -> 5000000 bytes
[3337:2915720] chunk index -> 3, data size -> 2636231 bytes
[3337:2915720] stage one success, mediaID -> 750564825571426304
[3337:2915709] Twitter Stage2 - 1 HTTP Response: 204,
[3337:2915720] Twitter Stage2 - 2 HTTP Response: 204,
[3337:2915715] Twitter Stage2 - final, HTTP Response: 204,
[3337:2915718] Twitter Stage3 HTTP Response: 201, {"media_id":750564825571426304,"media_id_string":"750564825571426304","size":12636231,"expires_after_secs":86400,"video":{"video_type":"video\/mp4"}}
[3337:2915867] Twitter Stage4 HTTP Response: 400, {"errors":[{"code":324,"message":"Duration too long, maximum:30000, actual:45205 (MediaId: snf:750564825571426304)"}]}
Thanks!