Due to popular demand… api.video has integrated a new API endpoint to the webservice to check the upload status and the encoding (per quality) status
UPLOAD STATUS
The video statuses are: missing, uploading or uploaded
If the upload is normal, you will get this kind of response:
{
"ingest": {
"status": "uploaded",
"filesize": 123456,
"receivedBytes": [ ]
},
If the upload is made by chunks, your response will give you all received bytes ranges.
Here is an example:
{
"ingest": {
"status": "uploaded",
"filesize": 273579401,
"receivedBytes": [
{
"to": 134217727,
"from": 0,
"total": 273579401
},
{
"to": 268435455,
"from": 134217728,
"total": 273579401
},
{
"to": 273579400,
"from": 268435456,
"total": 273579401
}
]
},
ENCODING STATUS
The video statuses are: waiting, encoding, encoded, failed
When the “playable” flag equals True, then at least one quality is encoded and your video is ready to be played.
Here is an example of the type of response you can get:
"encoding": {
"playable": true,
"qualities": [
{
"quality": "360p",
"status": "encoded"
},
{
"quality": "480p",
"status": "encoded"
},
{
"quality": "720p",
"status": "encoded"
},
{
"quality": "1080p",
"status": "encoding"
},
{
"quality": "2160p",
"status": "waiting"
}
],
"metadata": {
"width": 424,
"height": 240,
"bitrate": 411.218,
"duration": 4176,
"framerate": 24,
"samplerate": 48000,
"videoCodec": "h264",
"audioCodec": "aac",
"aspectRatio": "16/9"
}
}
}
Here is the full documentation about the Status: https://docs.api.video/5.1/videos/show-video-status
Feel free to let us know if it fits with your needs!