该接口用于创建抖音视频(支持话题, 小程序等功能)。该接口适用于抖音。
https://open.douyin.com/
开头。无
基本信息 | |
---|---|
HTTP URL | https://open.douyin.com/api/douyin/v1/video/create_video/ |
HTTP Method | POST |
Scope | video.create.bind |
权限要求 |
|
智能混剪合成:仅需上传 1 个长度为 15-60 秒的长视频即可,系统将抽取音频,随后裁剪为多个小
片段,用户发布视频时系统随机选择该模式下多个片段进行组合,再和抽取的音频合成。
智能随机组合:需上传至少 6 个(越多越好)6 秒以内的短视频,系统将视频转静音,用户发布视频
时系统随机选择该模式下的 5 个短视频素材随机组合,再和音频素材合成。
场景顺序组合:需在 5 个场景中分别上传至少 1 个或多个 6 秒以内的短视频,系统将视频转静音,
用户发布视频时系统在每个场景中随机选择 1 个短视频素材组合,再和音频素材合成。
智能图片组合:需上传尽可能多的图片素材,从中选择 6 个图片素材,用户发布视频时系统把图片
随机组合成视频,再和音频合成。
*:模式一旦选定后,请勿轻易切换视频合成模式,否则将导致素材清空,缓存视频清空
- $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_