Create an Encoding Job
To create a VOD encoding request, it is necessary to prepare certain resources beforehand, such as subtitles, a video file, and a watermark (if needed). Before submitting the encoding request, ensuring these required resources are available is important. If they are not already available, they must be uploaded to the Video library first. Once uploaded, their corresponding IDs can be obtained and used in the VOD encoding request.
For more information about uploading to Video Library, see Upload Assets.
Here's a simple diagram of the process:
Once you have ensured all the required resources exist and have obtained their corresponding IDs, you can create the VOD encoding request using those IDs. The request can include a subtitle, queue type, metadata, security control, privacy settings, watermarks, domain control, geo control, DRM, and schedule.
POST /bv/cms/v1/vods
{
"name":"string",
"profile_set_id":"string",
"source":{
"type":"SOURCE_TYPE_UNSPECIFIED",
"library":{
"video":{
"id":"string"
},
"subtitles":[
{
"id":"string",
"name":"string",
"code":"string",
"display":"string"
}
]
},
"cloud_storage":{
"id":"string",
"file_path":"string",
"subtitles":[
{
"id":"string",
"name":"string",
"code":"string",
"display":"string"
}
]
}
},
"queue":"QUEUE_STANDARD",
"pte":{
"profile":"PTE_PROFILE_UNSPECIFIED"
},
"metadata":{
"short_description":"string",
"long_description":"string",
"labels":[
{
"name":"string"
}
]
},
"security":{
"privacy":{
"type":"SECURITY_PRIVACY_TYPE_UNSPECIFIED",
"token":{
"device_limit":0
}
},
"watermark":{
"enabled":true,
"type":"WATERMARK_TYPE_UNSPECIFIED",
"position":"WATERMARK_POSITION_UNSPECIFIED",
"image":{
"library_id":"string"
}
},
"domain_control":{
"enabled":true,
"domains":[
"string"
]
},
"protection":{
"type":"PROTECTION_TYPE_UNSPECIFIED"
},
"geo_control":[
"string"
]
},
"schedule":{
"enable":true,
"start_time":"2019-08-24T14:15:22Z",
"end_time":"2019-08-24T14:15:22Z"
},
"export":{
"cloud_storage":{
"id":"string"
}
}
}
The followings introduce each important attribute in more detail:
Source
When requesting a VOD encoding to BlendVision, we need to specify the source and subtitles for the media file.
1. Determine the source type
The source type can be one of the following:
SOURCE_TYPE_LIBRARY
: if the source is uploaded from a local fileSOURCE_TYPE_CLOUD_STORAGE
: if the source is copied from specified cloud storage.
2. Create the source object
Based on the source type, create the source object accordingly.
If the source type is SOURCE_TYPE_LIBRARY
, create the source object as follows:
"source":{
"type":"SOURCE_TYPE_LIBRARY",
"library":{
"video":{
"id":"your_video_id_in_library"
}
}
}
If the source type is SOURCE_TYPE_CLOUD_STORAGE
, create the source object as follows:
"source":{
"type":"SOURCE_TYPE_CLOUD_STORAGE",
"cloud_storage":{
"id":"your_cloud_storage_id",
"file_path":"/path/to/cloud/storage/file.mp4"
}
}
For more details about cloud storage, see Utilize Cloud Storage for Video Management.
3. Specify subtitles for the media file
Subtitles must be uploaded using /bv/cms/v1/library/files:upload
API first, and the uploaded_data.id
from the response should be used to specify the subtitle in the source object. Here's an example of how to specify subtitles:
"source":{
"type":"SOURCE_TYPE_LIBRARY",
"library":{
"video":{
"id":"6d706ee2-a1c2-41fe-9a68-b8ef23604f1a"
},
"subtitles":[
{
"id":"your_subtitles_id",
"name":"English",
"code":"en",
"display":"true"
}
]
}
}
For more information about subtitles, see Updating Video Subtitles.
Queue
You can select the standard or faster queue for encoding jobs by setting the queue
field to QUEUE_STANDARD
or QUEUE_PRIORITY
. Noted that you will be charged a higher fee if you select
to process encoding jobs.
PTE
You can enable PTE by setting the profile
field in the pte
object to PTE_PROFILE_HIGH
for encoding jobs.PTE will be applied to every profile within the ProfileSet you choose.
Metadata
By providing additional information such as short description, long description, and labels, BlendVision One can enhance the classification, organization, and search capabilities of your content.
Here's an example of how to specify metadata:
"metadata":{
"short_description":"string",
"long_description":"string",
"labels":[
{
"name":"string"
}
]
}
About the metadata, you can find more information here.
Security
- Privacy
Manage the visibility of your content by specifying the regions or audiences authorized to access it, ensuring compliance with licensing agreements and target audience restrictions. For more information about privacy, see The Visibility of Content.
- Watermark
Overlay watermarks on your videos to claim copyright, deter piracy, and identify unauthorized usage, providing additional content protection. You can enable watermarking with a specified type and position. For more information about enabling a watermark, see Watermarks.
- Domain Control
Limit content delivery to authorized domains, ensuring that your content is only accessible on approved websites and platforms, reducing the risk of unauthorized distribution. For more information about enabling domain control, see Domain Control.
- Geo control
Restrict access to your content based on geographical regions, allowing you to target specific markets and comply with content distribution regulations. For more information about enabling geo control, see Geo-Region Control.
- DRM
By implementing DRM technologies such as FairPlay, PlayReady, and Widevine, you can encrypt your content and control its playback, preventing unauthorized copying and piracy. For more information about enabling DRM to protect your content, see Digital Rights Management.
For more information about security, see Security.
Schedule
By default, the content is always available; however,you can limit the availability of your content for a certain period by setting the start and end time.
If you want to schedule the availability, you can use the schedule
request body with the following options:
1.enable
This is a boolean value that determines whether the scheduling is enabled.
2.start_time
and end_time
The start_time
and end_time
specify the date and time when the content will become available and when it will no longer be available, respectively. The format for both start_time
and end_time
is ISO 8601
, which is YYYY-MM-DDTHH:MM:SSZ
.
The time zone is automatically detected and set to the local time zone of the user's location. This means that if a user is located in a different time zone than the server, the start_time
and end_time
will be automatically adjusted to match the user's local time zone.
Here is an example of a request body that schedules a video for playback from August 24th, 2023 at 2:15:22 PM UTC to August 31st, 2023 at 2:15:22 PM UTC:
"schedule":{
"enable":true,
"start_time":"2023-08-24T14:15:22Z",
"end_time":"2023-08-31T14:15:22Z"
}
If you want to edit a scheduled video's custom date and time, you can do so before the start or end time has passed. After that, the start and end times become non-editable.
- Before Scheduled Start Time: If the scheduled start time has not yet been reached, you can edit both the start and end times.
- Before Scheduled End Time: If the scheduled end time has not yet been reached, you can edit the end time.