TW API: video upload - specific video not valid



Hello everybody,

we have a quite rare problem that sometimes our video is not accepted from API when uploading. Most of videos are uploaded ok but it would be still great to know the root of problem.

Affected video example:

Endpoint used:

Error response:
“err”: {
“message”: “Not valid video”,
“type”: “TwitterAPI”,
“code”: 400,

The video is in compliance with all the parametres listed by API docs:
ok Supported video formats: .mp4
ok The maximum file size is 512 MB
ok Duration should be between 0.5 seconds and 140 seconds.
ok Dimensions should be between 32x32 and 1920x1200
ok The 1:3 aspect ratio is the narrowest a video can be. The 3:1 aspect ratio is the widest a video can be.
ok The maximum frame rate is 40 fps
ok Audio should be mono or stereo

Maybe there are some other restrictions to the video format?

Thank you for any answer, hint, advice.


Can you provide a media Id that failed for you in the past 24 hours?


Sure, this was just created (around 16:35 UTC)
media id: 1095360992823951362


Thanks @bruce_vilanch - I can see that there’s an error being reported on the media file but I’m not personally able to diagnose what the issue is; I’ve asked someone on the media team if they can suggest what is going on here. Thanks for your patience in advance.


The team had a look at this and it seems as though there was a corrupted frame towards the end of the file, which caused the h264 decoding to fail on ingest. I’m not sure what tools you might have for checking the validity of the file, but this seems to be what caused the issue on that specific media file.