源码所需服务器配置 1、规格:最低8核16G
2、硬盘:系统盘40-100G,数据盘不低于100G
3、带宽:10M
4、系统:CentOS7(务必选择7.*)
部署过程中,除对服务器有要求外,还需要提供准备备案域名,域名备案大致需要7-15个工作日,由于地区不同,备案审核的时间周期也不相同。
在视频批量剪辑过程中,采用了不同的剪辑模式:如,智能混剪,智能随机,场景顺序,图片组合等,未来还将根据市场开发,开发更多不同的功能
开发展示:
不会撰写爆款文案?
AI智能文案
行业文案库
添加自定义文案
第{{index+1}}个文案
{{item.copy}}
视频分发:采用代用户发布视频的形式
该能力的主要用途是:在用户授权的情况下,允许用户从开发者的应用上,将可公开的内容发布到用户自己的抖音账号作品里,并设置好相关的标题、话题、锚点等信息。
当前能力仅支持网站应用进行申请开通。
仅可在网站应用的电脑端网站中进行授权、使用,可用场景范围:
所使用到的接口列表为
/*
* 新增场景
*/
public function addSceneAction() {
$dv_id = $this->request->getIntParam('dv_id');
$name = $this->request->getStrParam('name');
$scene_model = new App_Model_Douyin_MysqlVideoSceneStorage();
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_item = $video_model->getRowByIdSid($dv_id, $this->sid);
if (empty($video_item)) {
$this->displayJsonError('参数错误');
}
$max_scene = $scene_model->getMaxSceneByDvid($dv_id);
$indata = [
'dvs_dv_id' => $dv_id,
'dvs_ds_id' => $this->sid,
'dvs_name' => $name,
'dvs_duration' => $video_item['dv_video_shot']*1000,
'dvs_scene' => $max_scene+1,
'dvs_create_time' => time(),
];
$ret = $scene_model->insertValue($indata);
if ($ret) {
$video_model->incNumberById('dv_video_use', 1, $dv_id);
}
$url = "/dydqtshoppc/video/startProject?dv_id={$dv_id}&type=1&scene=".$indata['dvs_scene'];
$this->displayJsonSuccess(['url' => $url], true, '添加成功');
}
public function deleteSceneAction() {
$dv_id = $this->request->getIntParam('dv_id');
$scene = $this->request->getIntParam('scene', 1);
if ($scene == 1) {
$this->displayJsonError('第一个场景不允许删除');
}
$scene_model = new App_Model_Douyin_MysqlVideoSceneStorage();
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$where = [
['name' => 'dvs_ds_id', 'oper' => '=', 'value' => $this->sid],
['name' => 'dvs_dv_id', 'oper' => '=', 'value' => $dv_id],
['name' => 'dvs_scene', 'oper' => '=', 'value' => $scene]
];
$ret = $scene_model->deleteValue($where);
if ($ret) {
$video_model->decNumberById('dv_video_use', 1, $dv_id);
}
$url = "/dydqtshoppc/video/startProject?dv_id={$dv_id}&type=1&scene=1";
$this->displayJsonSuccess(['url' => $url], true, '删除成功');
}
/*
* 视频缓存
*/
public function cacheVideoAction() {
//面包屑
$breadcrumbs = [
['title' => 'AI视频创意', 'link' => '#'],
['title' => '视频仓库', 'link' => ''],
];
$this->buildBreadcrumbs($breadcrumbs);
$dv_id = $this->request->getStrParam('dv_id');
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($dv_id, $this->sid);
if (empty($video_info)) {
$this->displayBlankPage('参数错误');
}
$this->output['video_info'] = $video_info;
//获取视频缓存列表
$where = [
['name' => 'dvtv_s_id', 'oper' => '=', 'value' => $this->sid],
['name' => 'dvtv_dv_id', 'oper' => '=', 'value' => $dv_id],
];
$cache_model = new App_Model_Douyin_MysqlVideoTempVideoStorage();
$template_list = $cache_model->getList($where,$this->index,$this->count);
foreach ($template_list as &$item) {
$item['score'] = 100 - min($item['dvtv_score'], 100);
$use_platform = empty($item['dvtv_use_platform']) ? [] : json_decode($item['dvtv_use_platform'], 1);
$use_platform = array_unique($use_platform);
$item['used_count'] = count($use_platform);
$item['used_platform'] = $use_platform;
}
//计算分页
$template_list_all = $cache_model->getCount($where);
$page_libs = new Libs_Pagination_Paginator($template_list_all,$this->count,'jquery',true);
$pageHtml = $page_libs->render();
$this->output['template_list'] = $template_list;
$this->output['pageHtml'] = $pageHtml;
$this->output['dv_id'] = $dv_id;
$this->output_materail_link($dv_id, 0, $video_info);
//点数展示
$collect_model = new App_Model_Douyin_MysqlCollectShopStorage();
$collect_info = $collect_model->getCollectSurplusBySid($this->sid);
$this->output['collect_info'] = $collect_info;
//预约列表
$appoint_model = new App_Model_Task_MysqlAppointTaskStorage();
$appoint_where = [
['name' => 'va_ds_id', 'oper' => '=', 'value' => $this->sid],
['name' => 'va_dv_id', 'oper' => '=', 'value' => $dv_id],
#['name' => 'va_status', 'oper' => '<>', 'value' => 2],
];
$appoint_sort = ['va_status' => 'ASC'];
$appoint_list = $appoint_model->getList($appoint_where, 0, 1, $appoint_sort);
$this->output['appoint_list'] = $appoint_list;
$this->output['platform_list'] = $this->platform;
$this->output['appoint_status'] = [
0 => '待执行',
1 => '执行中',
2 => '已结束',
3 => '异常中断',
];
$this->displaySmarty('dydqtshoppc/video/edit-project.tpl');
}
/*
* 生成预览视频
*/
public function previewVideoAction() {
$dv_id = $this->request->getIntParam('dv_id');
$temp_id = $this->request->getIntParam('temp_id', 0);
$cache_model = new App_Model_Douyin_MysqlVideoTempVideoStorage();
$cache_video = $cache_model->getPreviewVideo($dv_id);
//判断点数
$collect_model = new App_Model_Douyin_MysqlCollectShopStorage();
$collect_info = $collect_model->getCollectSurplusBySid($this->sid);
if (!$collect_info['cs_surplus']) {
$this->displayJsonError('无可用点数,无法合成预览视频');
}
if (empty($temp_id)) {
if ($cache_video) {
$this->displayJsonSuccess(['path' => $cache_video['dvtv_video_path']], true, '合成成功');
} else {
$this->createTempVideoAction($dv_id, 1);
$this->displayJsonSuccess(null, true, '预览视频正在努力合成中……');
}
} else {
$cache_id = empty($cache_video) ? 0 : $cache_video['dvtv_id'];
if ($temp_id == $cache_id) {
$this->displayJsonSuccess(null, true, '预览视频正在努力合成中……');
} else {
$this->displayJsonSuccess(['path' => $cache_video['dvtv_video_path']], true, '合成成功');
}
}
}