Special Resource Processing Transcoding times
gif You need to turn a whole-part of MP4, and then turn a mutipart of MP4. The whole-party of MP4 is used for compile, and the mutipart of MP4 is used for frontend preview 2
sequence diagram(tga, png, jpg) You need to turn a whole-part of MP4, and then turn a piece of MP4. The whole-part of MP4 is used for compile, and the piece of MP4 is used for frontend preview 2
video with alpha channel slice the video normally
transcoding proview

if with alpha*
1.singled-video with alpha transcoding
compile (compile terminal do not use)
2.mutipart-video alpha
trancoding preview
3
sequence diagram with alpha channel trans-singled video transcoding
compile*
if with alpha*
1.singled-video with alpha no transcoding
2.mutipart-video alpha no transcoding
* trans-mutipart video transcoding
preview*
if with alpha*
1.singled-video with alpha
transcoding
compile*
2.mutipart-video alphatranscoding
preview
4

# gif, tga transcoding and sequence diagram transcoding need to be transcoded twice

The reason why transcoding needs to be done twice is that gif itself is not a video, so there is no way to it when compiling. gif needs to be converted into a video before it can be compiled. The purpose of the second transcoding is for subsequent compiling. There is no difference between the first transcoding and the transcoding process of normal video.

The interface of creating transcoding task【/ job / create】is called for the first time. The resourceType of the request body is 1 and isSingleSlice is false After the first transcoding, save the transcoded product m3u8 file and other information into the record of the corresponding database video table in the process of receiving the request of 【/ job / transcode / complete】.

#

Request Body:

{
  "uuid": "uuid", //  task uuid
  "type": 0,      //  task type,0-transcoding,1-compile
  "data": {
    "url": "...",           // url if the task is transcoding task,and its is url of video-audio-iamge,if the task is composing task,its is url of project file.
    "callbackHost": "...",  // Host of callbacking
    "resourceType": 1,      // task resource type
    "isDir": false,         // directory or not
    "isSingleSlice": false, // multipart or not
    "isAlpha": false,       // transcoding alpha video or not
    "resourceNames": []     // resource file list of directory
  }
}

The second time, the interface of creating transcoding task 【/ job / create】is called. The resourceType of the request body is 1 and isSingleSlice is true At the end of the second transcoding, in the process of receiving the request of 【/ job / transcode / complete】, save the information such as the transcoding product singleSliceUrl file into the record of the corresponding database video table.

Request Body:

{
  "uuid": "uuid", // task uuid
  "type": 0,      // task type,0-transcoding,1-compile
  "data": {
    "url": "...",           // if the task is transcoding task,and its is url of video-audio-iamge,if the task is composing task,its is url of project file.
    "callbackHost": "...",  // Host of callbacking
    "resourceType": 1,      // task resource type
    "isDir": false,         // directory or not 
    "isSingleSlice": true,  // multipart or not
    "isAlpha": false,       // transcoding alpha video or not 
    "resourceNames": []     // resource file list of directory 
  }
}

# video transcoding with alpha channel

The reason why the video needs to be transcoded three times is that after the first normal transcoding, the flag of whether the video with alpha will be returned. If the video with alpha, it needs to convert a whole-part alpha video for compile, and another mutipart video for frontend preview.

The interface of creating transcoding task 【/ job / create】 is called for the first time. The resourceType of the request body is 1 and isAlpha is false At the end of the first transcoding, in the request processing of receiving 【/ job / transcode / complete】, the needTranscodeAlphaChannel field in the returned request body is true, and whether to transfer alpha channel video is determined according to this field.

Response Body

{
  "duration": 50000,
  "metadataFilePath": "/opt/bsedit/<uuid>.m3u8",
  "outputFileType": 0,
  "needTranscodeAlphaChannel": true,
  "videoWidth": 1280,
  "videoHeight": 720
}

The second call creates the transcoding task 【/ job / create】 interface. The resourceType of the request body is 1, isSingleSlice is true, and isAlpha is true At the end of the second transcoding, when receiving the request processing of 【/ job / transcode / complete】,save the information such as the transcoding product singleSliceUrl file into the record of the corresponding database video table and table field is alpha_url . The command line of the transcoder needs to take the -- generate alpha channel parameter to represent the conversion of alpha video.

Request Body:

{
  "uuid": "uuid", // task uuid
  "type": 0,      // task type,0-transcoding,1-compile
  "data": {
    "url": "...",           // if the task is transcoding task,and its is url of video-audio-iamge,if the task is composing task,its is url of project file.
    "callbackHost": "...",  // Host of callbacking
    "resourceType": 1,      // task resource type
    "isDir": false,         // directory or not 
    "isSingleSlice": true,  // multipart or not
    "isAlpha": true,        // transcoding alpha video or not
    "resourceNames": []     // resource file list of directory 
  }
}

The third call creates the transcoding task【 / job / create】 interface. The resourceType of the request body is 1, isSingleSlice is false, and isAlpha is true After the second transcoding, when receiving the request processing of 【/ job / transcode / complete】,save the information such as the transcoding product m3u8Url file into the record of the corresponding database video table and table field is alpha_m3u8_url.The command line of the transcoder needs to take the -- generate alpha channel parameter to represent the conversion of alpha video.

Request Body:

{
  "uuid": "uuid", // task uuid
  "type": 0,      // task type,0-transcoding,1-compile
  "data": {
    "url": "...",           // if the task is transcoding task,and its is url of video-audio-iamge,if the task is composing task,its is url of project file.
    "callbackHost": "...",  // Host of callbacking
    "resourceType": 1,      // task resource type
    "isDir": false,         // directory or not 
    "isSingleSlice": false, // multipart or not
    "isAlpha": true,        // transcoding alpha video or not
    "resourceNames": []     // resource file list of directory
  }
}

# sequence diagram with alpha

Sequence diagram with alpha channel is a combination of sequence diagram and alpha video transcoding.