-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any callback or web-hook when the processing is finished ? #120
Comments
Paying business user here and I definitely agree a webhook for when videos are done processing would be really, really helpful. With the way the API works currently, I have to continually poll the Vimeo API until the video is done processing. I really don't think this is optimal. |
same here... this is not cost effective even for vimeo. lots and lots of users pinging their server |
any solution found on this? |
@Tariqali13 what I suggest doing is as soon as video is uploaded create db entry for that uri with status of "in_progress" const unprocessedSnapshot = await admin
.firestore()
.collection('videos')
.where('status', '==', 'in_progress')
.get();
const unprocessedDocs = unprocessedSnapshot.docs;
if(!unprocessedDocs.length) return null;
const response = await axios(
'https://api.vimeo.com/me/videos?fields=uri,transcode.status',
{
headers: { Authorization: 'bearer 4e01e30bfyouraccesstokenhere7013642b6' },
}
);
interface MapInterface {
[key: string]: {
status: string,
}
}
const map: MapInterface = {};
for (const item of response.data.data) {
map[item.uri] = {
status: item.transcode.status,
};
}
for (const doc of unprocessedDocs) {
const video = doc.data();
await admin
.firestore()
.collection('videos')
.doc(doc.id)
.update({
...map[video.uri]
});
} |
@pavanjadhaw thanks. that's a good solution but hope in future we will get a callback by vimeo |
I bet that if Vimeo wants, a lot of coders would help to implement the webhook feature. I would. And again. Lots of “pinging” on the server versus one call to the webhook would unclutter services. |
Can anyone from Vimeo comment on this? This feature would really be enormously helpful. |
Hi, i have found that bit of undocumented useful code while browsing the repo examples: client.upload(
filePath,
params,
function (uri) {
// UPLOAD SUCCESS but NOT TRANSCODED
// Get the metadata response from the upload and log out the Vimeo.com url
client.request(uri + '?fields=link', function (error, body, statusCode, headers) {
if (error) return console.error('There was an error making the request.')
console.log('"' + filePath + '" has been uploaded to ' + body.link)
// Make an API call to see if the video is finished transcoding.
client.request(
uri + '?fields=transcode.status',
function (error, body, statusCode, headers) {
if (error) return console.error('There was an error making the request.')
console.log('The transcode status for ' + uri + ' is: ' + body.transcode.status)
}
)
})
})
},
function (bytesUploaded, bytesTotal) { },
function (error) { }
) You can start from this example to find a way to check for uploaded AND transcoded status for the video ^^ |
Sorry to say, but you didn't understand the problem |
Been a paying business user for about 2 years now and still no solution for this yet. I still have my polling solution in place but it would really be so much better if Vimeo implemented some sort webhook/callback feature here. |
A webhook is available by default in a lot of services nowadays. It'd be very useful to be notified by Vimeo if a video was uploaded/changed. We could even pay a bit extra for this feature (although it should not put too much toll on their systems). In my case I'd like to keep my custom apps and their service in sync. So, for example, whenever something happens to a video via Vimeo's UI my app would be notified so it could do additional processing. Wondering if there is a way to make this more visible to Vimeo since it's not javascript specific. |
Not sure but to be honest I am considering switching video hosting services. This library seems completely abandoned at this point and video uploads are an important feature for my business. It would be nice to know that the library I am using (as a paying customer) is at the very least being maintained. 2023 edit: |
are there any updates on this? also what would be a good alternative to Vimeo? Dev support is more important than price |
@rubenheymans Azure Media Services is a good product. It gives more control over the process but is more complex to setup. It also came out cheaper (for our project) than Vimeo. And Azure support is good. |
Currently the only way to view when a video completes transcoding is by polling, i.e. If you'd like to see a Webhook interface, please request it at: |
Since this // GET /videos/{video_id}?fields=status
type VimeoVideoStatusResponse = {
status:
| 'available'
| 'quota_exceeded'
| 'transcode_starting'
| 'transcoding'
| 'transcoding_error'
| 'uploading'
| 'uploading_error';
}; |
|
WorkaroundIn case this is useful for anyone else, polling using a recursive async function that calls // Docs: https://developer.vimeo.com/api/reference/response/video#:~:text=available%20%2D%20The%20video%20is%20available.,an%20error%20in%20uploading%20the%20video.
export type VimeoVideoStatus =
| 'available'
| 'quota_exceeded'
| 'total_cap_exceeded'
| 'transcode_starting'
| 'transcoding'
| 'transcoding_error'
| 'unavailable'
| 'uploading'
| 'uploading_error';
/**
* Get the transcode status of a Vimeo video
*/
export function getStatusByVideoIdRecursive(videoId: number): Promise<
| {
errors: Errors,
}
| {
status: VimeoVideoStatus,
},
> {
return new Promise((resolve, reject) => {
client.request(
`/videos/${videoId}?fields=status`,
(error, response: { status: VimeoVideoStatus }) => {
if (error) {
return reject(error);
}
if (['transcode_starting', 'transcoding'].includes(response.status)) {
return resolve(
new Promise((resolveInner) => {
setTimeout(
() => resolveInner(getStatusByVideoIdRecursive(videoId)),
1000,
);
}),
);
}
resolve({
status: response.status,
});
},
);
});
} |
Here's an updated version of the script above, using |
My opinion: We KNOW this is better for VIMEO and for us.The issue here is: It is not an issue for vimeo! Why? Because we are too kind! C'mon devs @ vimeo... |
@fweffort If you reach out to support (https://vimeo.com/help/contact) you can be opted in to the webhooks beta. |
@aaronm67 thanks for the tip! Wasn't aware there was a webhooks beta. Here's how I submitted the form, not sure if you would suggest doing it differently: Instructions:
Subject:
Description:
|
I uploaded the video to Vimeo and it succeeds. but when I using the URL, It seems like the video still processing that video. So Is there any callback or web-hook to notified me back when it finished the processing.
The text was updated successfully, but these errors were encountered: