Last update:2022-04-13 09:24:28
Currently, the commonly used video encapsulation formats include FLV, MP4, HLS, Dash, etc. With each has its own unique features, these formats are applied in different business scenarios:
Transmuxing is a processing method that packages the encoded and compressed video and audio tracks into a complete multimedia file according to a certain format.
CDNetworks supports mutual conversion between commonly used video encapsulation formats, such as:
For video or audio formats which cannot be recognized by cloud transcoding, transmuxing will fail. Customer will receive the notification of transmuxing failure along with the failure cause.
Figure 1 Video Transmuxing Workflow
(1) Customer calls the cloud storage API to upload the video file and assigns a transmuxing instruction;
(2) After receiving the task, the cloud storage assembles the transmuxing instruction and assigns the instruction to the cloud transcoding;
(3) Cloud transcoding fetches the video file from the cloud storage for transmuxing operation, and uploads the processed video file to the cloud storage;
(4) Cloud storage notifies the customer of the target video address through API callback;
(5)(6)(7)(8) For the customer adopting CDN acceleration service, their users will utilize the video address that the cloud storage sends to customer, to interact with CDN PoPs.
Note: Cloud transcoding is a dedicated system platform for video file processing developed by CDNetworks.
Support any input of video encapsulation formats such as FLV, MP4, Dash and HLS, and any output formats, as long as the output parameters specify the format.
Parameter | Required | Description |
<op> | Yes | avthumb (operation type-video processing) |
<format> | Yes | Target output format, such as mp4, flv, m3u8 and mpd. |
/vn/<VideoNo> | No | Whether to remove the video stream, 0 is preserve and 1 is remove. The default value is 0. |
/an/<VideoNo> | No | Whether to remove the audio stream, 0 is preserve and 1 is remove. The default value is 0. |
Segment parameter | ||
/segtime/<SegSeconds> | No | It is used to define the playback duration of each audio/video stream. Unit: second, and the value is a integer ranging from 1 to 120.
Note: the below is the value adoption specification when the parameter is not set:
|
1. Specific parameter of HLS segment | ||
/fastStartSeg/<FastStartSeg> | No | N second(s) is the duration of first M pieces of ts segments when slicing into m3u8 segments, and the parameter format is MxNs. For example:5x3s means that the slice length of the first 5 ts segments are 3 seconds. |
2. Specific parameter of DASH segment | ||
/segtype/<segtype> | No | Generated DASH file format, such as mp4 or m4s, and the default is m4s. |
Take DASH segmentation as an example, and the transmuxing of mp4, flv and HLS can be processed with a similar method.
Make the DASH segments from lixm-test.mp4 video under the space of vod-wcs-test001, and rename mpd as lixm-test_file.mpd.
(1) Step 1:Obtain AK and SK from CDNetworks SI.
(2) Step 2: HLS segment path is /fops.
(3) Step 3:request content body is
Before encryption:
bucket=Urlsafe_Base64_Encode(vod-wcs-test001)&key=Urlsafe_Base64_Encode(lixm-test.mp4)&fops=Urlsafe_Base64_Encode(avthumb/mpd|saveas/Urlsafe_Base64_Encode(vod-wcs-test001:lixm-test_file.mpd))&force=1&separate=1
After encryption:
bucket=dm9kLXdjcy10ZXN0MDAx&key=bGl4bS10ZXN0Lm1wNA==&fops=YXZ0aHVtYi9tcGR8c2F2ZWFzL2RtOWtMWGRqY3kxMFpYTjBNREF4T214cGVHMHRkR1Z6ZEY5bWFXeGxMbTF3WkE9PQ==&force=1&separate=1
(4) Step 4: Utilize AK, SK, path and Body to generate the access token Authorization.
and mgrAuthorization_A:mgrAuthorization_B represents the access token in this example.
(5) Step 5: Obtain management domain from CDNetworks SI and it is replaced by mgrDomain in this example.
(6) Step 6: Execute command
curl -v -X POST -d “bucket=dm9kLXdjcy10ZXN0MDAx&key=bGl4bS10ZXN0Lm1wNA==&fops=YXZ0aHVtYi9tcGR8c2F2ZWFzL2RtOWtMWGRqY3kxMFpYTjBNREF4T214cGVHMHRkR1Z6ZEY5bWFXeGxMbTF3WkE9PQ==&force=1&separate=1” -H “Authorization:mgrAuthorization_A:mgrAuthorization_B” --url “http://mgrDomain/fops”
Lastly, check the vod-wcs-test001 space for the mpd and m4s file generated.
Figure 2 Result of DASH segmentation command execution
(1) VoD Transmuxing is a value-added service and will be charged separately for usage.
(2) Video processing-related features can only manipulate video files stored on media cloud storage, so media cloud storage service should be enabled as well.
(3) Billing mode:
a) Video transmuxing is charged according to the total playback time of the video files to be processed (unit: minute/month);
b) The prices of video transmuxing and transcoding are different. If the transcoding parameter is configured as well when setting transmuxing, then customers will be charged the transcoding price (unit: minute/month);
c) Media Cloud storage is charged according to the monthly storage peak (unit: GB/month).