[overwolf.social.twitter.share] "UnknownError" on Not valid video

Issue Description:

Sometimes, we get UnknownError error from Twitter.
Looking at the logs, we can see the unerlying error:

2022-09-10 19:48:48,139 (ERROR) [73][22800] <1810.95MB> TwitterApi - Failed to publish tweet: : Reason : Bad Request
Details : Not valid video (324)
Code : 400
Date : 09/10/2022 19:48:48 +09:00
URL : https://api.twitter.com/1.1/statuses/update.json?status=%E3%83%97%E3%83%A9%E3%82%A4%E3%83%A0%E3%81%84%E3%81%84%E3%81%AD%EF%BD%9E&media_ids=1568551823874871296&tweet_mode=extended
Twitter documentation description : Bad Request - The request was invalid or cannot be otherwise served. An accompanying error message will explain further. In API v1.1, requests without authentication are considered invalid and will yield this response.

2022-09-10 19:48:48,141 (ERROR) [73][22800] <1810.95MB> TwitterApi - Failed to publish tweet

We would like to get a specific error when this issue occurs so we can let our users know what is the problem.
In addition, After reading about Not valid video (324), it seems like it has to do with the chunked upload. maybe this issue is solvable?

Can you reproduce it (exact steps to reproduce):


Impact for my app:

low (60 users daily)

Do you currently have a workaround?


User Logs:


We’re looking into this issue, and will keep you updated as it progresses.

Do keep in mind that this might have something to do with those users trying to upload videos recorded with Quick Sync that do not fit into twitter’s “uploaded video spec”. You can find one example of that in the first item noted here (less than 30 fps).

1 Like

After looking into it, it seems that the videos were in fact not “legal” to upload to twitter:

“Uploading a video to twitter recorded with quick sync and is above 30 FPS is not allowed”

Having a look at both log files,
1st user is capturing at 90 fps,
2nd user is capturing at 120fps

Moving this to feature requests, to have a clearer warning about it.
As for the actual issue, when it does happen, you can use the following ffmpeg command-line to fix it:

$ ffmpeg -i <YOUR_VIDEO>.mp4 -c:v libx264 -b:v 4M -x264-params keyint=24:bframes=2 <CORRECTED_VIDEO>.mp4

Where <YOUR_VIDEO> and <CORRECTED_VIDEO> are the current file and the output file you want (without <>)

This will also be added to the docs in the future

1 Like

Update for future reference:
Twitter videos are also capped at 60 fps, regardless of encoder (Quick Sync is still capped at 30 fps)

1 Like