Video status & details
api.video gives you ways of checking the video upload status and video details.
To check the video upload status or details of the encoding, you can either use webhooks or API polling by making a request to /videos/{videoId}/status endpoint.
Listening to Webhooks for Video Status & Encoding
By subscribing to video.encoding.quality.completed
webhook, each time the video changes its upload status, the URL you've set, will receive a POST request with the following payload.
{
"type": "video.encoding.quality.completed",
"emittedAt": "2021-01-29T16:46:25.217+01:00",
"videoId": "viXXXXXXXX",
"encoding": "hls",
"quality": "720p"
}
You can subscribe to webhooks by making a request to the /webhooks endpoint.
Webhook payload details
Retrieving The Video Status & Details
The other option at your disposal would be to poll the API for the video status and details. After creating the video object, and making a request to upload the video, you can start polling the /status
endpoint. You will get the video upload status, encoding, source video details, and more with the returned payload.
You can make a request to the /status
endpoint at any time even after the video was uploaded to get details like the video duration, file size, video size and etc.
The response from the /status
endpoint will be as follows:
{
"ingest": {
"status": "uploaded",
"filesize": 23037467,
"receivedBytes": []
},
"encoding": {
"playable": true,
"qualities": [
{
"type": "hls",
"quality": "240p",
"status": "waiting"
},
{
"type": "hls",
"quality": "360p",
"status": "encoding"
},
{
"type": "hls",
"quality": "480p",
"status": "encoding"
},
{
"type": "hls",
"quality": "720p",
"status": "waiting"
},
{
"type": "mp4",
"quality": "720p",
"status": "encoded"
}
],
"metadata": {
"width": 1280,
"height": 720,
"bitrate": 766,
"duration": 200,
"framerate": 24,
"samplerate": 44100,
"videoCodec": "h264",
"audioCodec": "aac",
"aspectRatio": "16:9"
}
}
}
ingest
The ingest property will reflect the status of the ingestion with the file size and if you are using progressive upload, then also the received bytes:
status
uploading
last_chunck_uploaded
merging
uploaded
filesize
receivedBytes
encoding
The encoding property will provide information about each asset and which quality was already encoded and can be delivered.
playable
qualities
- type : The type of the encoding, with possible values of
hls
ormp4
- quality : The quality of the encoded asset. Possible values:
240p
,360p
,480p
,720p
,1080p
,2160p
(4k) - status : The status of the current encoding. The status will reflect whether the video is enqueued, encoded, or failed. Possible values:
waiting
- enqueued for encoding.encoding
- the encoding is in progress.encoded
- the video has been encoded and is ready for delivery.failed
- the encoding for this particular quality has failed.
- type : The type of the encoding, with possible values of
metadata
Provides data on the source video
Usage
To install your selected client, do the following:
Retrieve your API key
You'll need your API key to get started. You can sign up for one here: Get your api.video API key!. Then do the following:
Retrieve video upload status
To retrieve the status of a video you uploaded, use this code sample:
API documentation
Was this page helpful?