create video
This interface is used to create Douyin videos (support topics, applets, etc.). This interface is suitable for Douyin .
usage restrictions
- Douyin's OAuth API
https://open.douyin.com/
starts with . - To mount the applet, please complete the registration of the developer platform account first .
- After creating a Douyin video, there will be a review process during which only you can see it.
- If you want to @user to post a video, you need to get the nickname and open_id.
- The video interface is currently released and supports two types of anchor points, including: applets and POIs. Carrying multiple types of anchors is not supported .
- If you need to create a video on behalf of the user, in addition to authorization, each call needs to let the user clearly perceive the relevant operations in the product design. If it is found that the video is created on behalf of the user without the user's perception, the relevant interface permissions may be revoked and the application and account will be punished.
Interface Description
none
Basic Information
Basic Information |
|
---|---|
HTTP URL |
https://open.douyin.com/api/douyin/v1/video/create_video/ |
HTTP Method |
POST |
Scope |
video.create.bind |
permission request |
|
Video batch editing editing mode:
Introduction to Mixed Cut Mode
Intelligent mixing and cutting synthesis: only need to upload a long video with a length of 15-60 seconds, the system will extract the audio, and then cut it into multiple small
Fragments, when the user publishes a video, the system randomly selects multiple fragments in this mode to combine, and then synthesizes them with the extracted audio.
Smart random combination: At least 6 (the more the better) short videos within 6 seconds need to be uploaded, the system will mute the video, and the user will post the video
The system randomly selects 5 short video materials in this mode to combine randomly, and then synthesizes them with audio materials.
Combination of scene sequence: At least one or more short videos within 6 seconds need to be uploaded in each of the 5 scenes, the system will mute the video,
When a user publishes a video, the system randomly selects a short video material combination in each scene, and then synthesizes it with the audio material.
Smart picture combination: need to upload as many picture materials as possible, select 6 picture materials, and the system will combine the picture materials when the user publishes the video
Randomly combined into video, and then synthesized with audio.
*: Once the mode is selected, please do not switch the video synthesis mode easily, otherwise it will cause the material to be cleared and the cached video to be cleared
Material management:
Code display example:
$breadcrumbs = [
['title' => 'AI视频创意', 'link' => '#'],
['title' => '开始创作', 'link' => ''],
];
$this->buildBreadcrumbs($breadcrumbs);
//搜索专用
$keyword_type = $this->request->getStrParam('keyword_type');
$keyword = $this->request->getStrParam('keyword');
$this->output['keyword_type'] = $keyword_type;
$this->output['keyword'] = $keyword;
$dv_id = $this->request->getIntParam('dv_id'); //视频工程ID
$this->output['dv_id'] = $dv_id;
$type = $this->request->getIntParam('type', 0); //素材类型
$scene = $this->request->getIntParam('scene', 1);
$this->output['scene'] = $scene;
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($dv_id, $this->sid);
if (empty($video_info)) {
plum_redirect_with_msg('视频创意工程不存在');
}
$mixed_video_mode = $video_info['dv_video_mode'];
if (in_array($mixed_video_mode, [11])) { //智能图片组合
$type = in_array($type, [0, 1]) ? 3 : $type; //默认为图片素材类型
} else {
$type = in_array($type, [0, 3]) ? 1 : $type; //默认为视频素材类型
}
//获取素材列表
$where = [
['name' => 'dvm_ds_id', 'oper' => '=', 'value' => $this->sid],
['name' => 'dvm_dv_id', 'oper' => '=', 'value' => $dv_id],
['name' => 'dvm_material_type', 'oper' => '=', 'value' => $type]
];
//视频类型,区分混剪模式
if ($type == 1) {
$where[] = ['name' => 'dvm_video_mixed_mode', 'oper' => '=', 'value' => $video_info['dv_video_mode']];
}
if (!empty($keyword_type)) {
$where[] = ['name' => $keyword_type, 'oper' => 'like', 'value' => "%{$keyword}%"];
}
//智能场景组合,视频素材加场景值筛选
if ($type == 1 && $mixed_video_mode == 4) {
$scene_model = new App_Model_Douyin_MysqlVideoSceneStorage();
$scene_count = $scene_model->getCountByDvid($dv_id);
if ($scene_count == 0 && $video_info['dv_video_use'] > 0) {
for ($i = 1; $i <= $video_info['dv_video_use']; $i++) {
$indata = [
'dvs_ds_id' => $this->sid,
'dvs_dv_id' => $dv_id,
'dvs_name' => "场景" . $i,
'dvs_duration' => $video_info['dv_video_shot'] * 1000,
'dvs_