jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
776 stars 234 forks source link

Errors when uploading videos: Resolution too large/Duration too long #176

Closed mavalon closed 7 years ago

mavalon commented 8 years ago

I am using the code sample under "Video Files" in README.md. It works fine as long as I upload small videos. The limitations for uploaded videos is far more restrictive for sync than for async as noted here: https://dev.twitter.com/rest/media/uploading-media#videorecs

How can I upload asynchronously using codebird? I am getting the following error when trying to upload videos that don't meet the sync specifications:

"Resolution too large, too many pixels. Maximum: 1310720, Actual: 2073600" or "Duration too long, maximum:30000, actual:43266"

andypiper commented 8 years ago

We've just published a Python (not PHP) sample that works with larger videos. It may help you to understand the steps needed to move to the async model.

mavalon commented 8 years ago

@andypiper I don't know Python, but as far as I can tell, the logic looks pretty much the same as the Video Files example. I guess there is no way to accomplish this with PHP (and more specifically, with the codebird-php library).

mynetx commented 8 years ago

@andypiper How to trigger async processing? Will the Twitter server decide on its own, so I only need to check for processing_info in FINALIZE?

iDevelopThings commented 8 years ago

To deal with this problem, i used a video manipulation package to edit the video before uploading to twitter. It's the most efficient way i could think of. Although, it will take some playing around to get everything perfect, you need to install ffmpeg etc

mynetx commented 8 years ago

@ScooterSam Could you please connect with the OP in #171 and join forces to get these media upload issues fixed?

andypiper commented 8 years ago

According to the media upload (FINALIZE) docs, async behaviour is triggered when a media_category is specified.

This behavior is enabled if an upload session was initialized with a media_category parameter, and when the media type is either video or animated GIF.