"VideoTool threw an exception" on video upload



Over the last month, we’ve been encountering a very generic error message on some of our video uploads. Subsequent attempts to upload thru the twitter web app and api call seem to work. Should this be treated as a try again later type of error message, or is there something we need to change in the api calls/video payload?

{:media_id=>766724676466999303, :media_id_string=>“766724676466999303”, :size=>5534720, :processing_info=>{:state=>“failed”, :progress_percent=>100, :error=>{:code=>1, :name=>“InvalidMedia”, :message=>“VideoTool threw an exception”}}}

link to video: https://www.dropbox.com/s/6bgsry940oyr3tn/57aaf3868fefa873753cabbf_57b7628f57f56d74675bc306.mp4

link to retried post on own account:


Jonathan, did you ever get any more insight into this error? We’ve seen this a time or two as well and also haven’t found any actionable info.


Any update on this? We are experiencing the same issue. It is often (if not always) associated with posting a .mov file.

"VideoTool threw an exception" on video upload

Thanks for bubbling this back up - @rdwyer_sf I’m going to close your duplicate thread on this, and ask someone from the team to take a look back here if they can (bearing in mind it is heading into holiday season).


Hey there @andypiper!

Is there a timeframe planned for fixing or documenting this behaviour? We are currently experiencing a couple instances of this per hour. All videos are MP4 and look like they should post fine, since they are within the regular parameters! :slight_smile:

Thanks so much!


Hi @andypiper

I am trying to upload a 120 seconds video of size around 49MB,getting the same error “InvalidMedia”. we have created the file as per Twitter video specification and recommendations.

Really appreciate your view on this


Are you able to reproduce this using our large video upload sample?

Can you provide a link to an example file?

Are you able to provide a code snippet showing how you are uploading the media?


Yes, I am using the large video upload sample steps using the LinqToTwitter library.

I can upload 30, 60 and 90 seconds video without any issues, only 120 seconds and above durations we have this problem.

Tomorrow I will upload the file into YouTube and send you link.


We’d need a link to the original file not a YouTube-encoded version.

140 seconds is the limit for tweet_video type.

Please also try to upload using the actual Python code we’ve provided.


Please use the above dropbox link to download the 2 minutes file.



I have mailed the link for the video file which is not uploading via twitter UI and via API.


Looks like your video is 1920x1080 and the API supports maximum size of 1280x1024.



thanks Andy, I will reduce the file size as per API support and try to load again.


Hi @andypiper .
I also faced with such error. Video is not uploading via twitter UI and API. Sending you example of file - https://drive.google.com/file/d/1UUxdAUeut63jd2-EvqfWfJ_REZmCcYz_/view .
Thanks for any help.


Seems like there’s something wrong with the encoding of the file. I just re-encoded it using ffmpeg

$ ffmpeg -i qwerqwrq.mp4 -4 mp4 -o qwerqwrq2.mp4

The generated file was posted successfully via the API.


I am also encountering this issue. Here is my video: https://drive.google.com/file/d/1x4PC4du06YHEfsCWeGHfPyf8px-WhSiX/view?usp=sharing. It works when the audio is removed but I would love to get it uploaded with audio. The audio track is an AAC Low Complexity with 2 channels which matches the criteria. Maybe there are other criteria which aren’t documented? @andypiper would you mind checking it out?


I was able to resolve the issue by using libfdk_aac instead of aac and setting the sample rate to 44100.