curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode \
--header 'AccessKey: <api-key>'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode"
headers = {"AccessKey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {AccessKey: '<api-key>'}};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"videoLibraryId": 123,
"guid": "<string>",
"title": "<string>",
"dateUploaded": "2023-11-07T05:31:56Z",
"views": 123,
"isPublic": true,
"length": 123,
"status": 0,
"framerate": 123,
"width": 123,
"height": 123,
"outputCodecs": "<string>",
"thumbnailCount": 123,
"encodeProgress": 123,
"storageSize": 123,
"hasMP4Fallback": true,
"averageWatchTime": 123,
"totalWatchTime": 123,
"description": "<string>",
"rotation": 123,
"availableResolutions": "<string>",
"captions": [
{
"srclang": "<string>",
"label": "<string>",
"version": 123
}
],
"collectionId": "<string>",
"thumbnailFileName": "<string>",
"thumbnailUrl": "<string>",
"thumbnailBlurhash": "<string>",
"category": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
],
"transcodingMessages": [
{
"timeStamp": "2023-11-07T05:31:56Z",
"level": 0,
"issueCode": 0,
"message": "<string>",
"value": "<string>"
}
],
"jitEncodingEnabled": true,
"smartGenerateStatus": 0,
"smartGenerateFeaturesStatus": {
"title": 0,
"description": 0,
"chapters": 0,
"moments": 0
},
"hasOriginal": true,
"originalHash": "<string>",
"hasHighQualityPreview": true
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Reencode Video
Re-encodes the video from its stored original file. Requires the original file to still be present in storage. If the library has transcribing enabled, this also re-queues (and re-bills) transcription.
curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode \
--header 'AccessKey: <api-key>'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode"
headers = {"AccessKey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {AccessKey: '<api-key>'}};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/reencode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"videoLibraryId": 123,
"guid": "<string>",
"title": "<string>",
"dateUploaded": "2023-11-07T05:31:56Z",
"views": 123,
"isPublic": true,
"length": 123,
"status": 0,
"framerate": 123,
"width": 123,
"height": 123,
"outputCodecs": "<string>",
"thumbnailCount": 123,
"encodeProgress": 123,
"storageSize": 123,
"hasMP4Fallback": true,
"averageWatchTime": 123,
"totalWatchTime": 123,
"description": "<string>",
"rotation": 123,
"availableResolutions": "<string>",
"captions": [
{
"srclang": "<string>",
"label": "<string>",
"version": 123
}
],
"collectionId": "<string>",
"thumbnailFileName": "<string>",
"thumbnailUrl": "<string>",
"thumbnailBlurhash": "<string>",
"category": "<string>",
"chapters": [
{
"title": "<string>",
"start": 123,
"end": 123
}
],
"moments": [
{
"label": "<string>",
"timestamp": 123
}
],
"metaTags": [
{
"property": "<string>",
"value": "<string>"
}
],
"transcodingMessages": [
{
"timeStamp": "2023-11-07T05:31:56Z",
"level": 0,
"issueCode": 0,
"message": "<string>",
"value": "<string>"
}
],
"jitEncodingEnabled": true,
"smartGenerateStatus": 0,
"smartGenerateFeaturesStatus": {
"title": 0,
"description": 0,
"chapters": 0,
"moments": 0
},
"hasOriginal": true,
"originalHash": "<string>",
"hasHighQualityPreview": true
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Authorizations
AccessKey based authentication
Path Parameters
The ID of the video library.
The GUID of the video.
Response
The details of the requested video
The ID of the video library that the video belongs to
The unique ID of the video
1The title of the video
1The date when the video was uploaded
1The number of views the video received
Determines if the video is publically accessible
The duration of the video in seconds
The status of the video. See VideoModelStatus.
0 The framerate of the video
The width of the original video file
The height of the original video file
Comma-separated list of output codecs generated for this video (e.g. "x264,vp9"). See EncoderOutputCodec for possible values.
1The number of thumbnails generated for this video
Encoding progress as a percentage from 0 to 100; reaches 100 when transcoding finishes.
Total storage used by this video, in bytes.
Determines if the video has MP4 fallback files generated
The average watch time of the video in seconds
The total video watch time in seconds
The description of the video
Rotation of the source file in degrees as read from container metadata (e.g. 90, -90, 180, 270); null when no rotation metadata is present.
Comma-separated list of resolution labels (e.g. "360p,720p,1080p") that have finished encoding and are available for playback.
The list of captions available for the video
Show child attributes
Show child attributes
The ID of the collection where the video belongs
The file name of the thumbnail inside of the storage
The CDN URL of the thumbnail
Thumbnail blurhash to show while the actual thumbnail is being loaded
Automatically detected content category label; "untagged" when no category has been determined yet.
The list of chapters available for the video
Show child attributes
Show child attributes
The list of moments available for the video
Show child attributes
Show child attributes
The list of meta tags that have been added to the video
Show child attributes
Show child attributes
The list of transcoding messages that describe potential issues while the video was transcoding
Show child attributes
Show child attributes
Whether just-in-time encoding is enabled for this specific video, overriding the video library's default JitEncodingEnabled setting when set. Null means the library default applies.
Aggregate smart generate status derived from per-feature statuses when present: InProgress, then Queued, then Failed, then Finished; otherwise the stored legacy value. See SmartGenerateFeaturesStatus.
0 Per-feature smart generate statuses (title, description, chapters, moments). Null for a feature on legacy rows.
Show child attributes
Show child attributes
Determines if video has the original file available in storage
Original uploaded file SHA256 hash
Whether a high-quality animated preview has been generated for this video.
Was this page helpful?