Why "Not valid video"

restapi
video

#1

I make app of up to video over 30 second under 140 second but can’t upload video .
error message was “twitter.error.TwitterError: [{u’message’: u’Not valid video’, u’code’: 324}]”

could you tell me this error


#2

Are you able to share a link to the video somewhere so that the team can take a look?

Also, if you are able to test your video yourself using our large video upload sample, it might confirm whether the code is the issue or the video file itself has a format problem.


#3

I was getting the same error because I was trying to create the tweet before the video was done being processed by twitter. I had to add the following after the code for FINALIZE:

$videoCount = 0;
do
{
    $tmhOAuth->request(
        'GET',
        $tmhOAuth->url('/1.1/media/upload.json'),
        array(
            "command" => "STATUS",
            "media_id" => $mediaID,
        )
    );
    $twitterResult = json_decode($tmhOAuth->response['response']);
    if ($twitterResult->processing_info->state != 'succeeded')
    { sleep(5); }
    $videoCount++;
}
while ($twitterResult->processing_info->state != 'succeeded' && $videoCount < 5);