多账号矩阵管理系统技术嫁接开发源代码
文章目录
- 一、剪辑部分源代码开发示例
- 二、发布投放部分源代码示例
- 1.账号绑定一码多扫技术应用开发代码示例
- 2.定时挂载投放源代码示例
一、剪辑部分源代码开发示例
创建工程项目
*/
public function createProjectAction() {
$this->useLayout('dydqtshoppc-head.html');
$id = $this->request->getIntParam('id');
//获取视频信息
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($id, $this->sid);
$use_platform = empty($video_info['dv_use_platform']) ? [] : json_decode($video_info['dv_use_platform'], 1);
if (!empty($video_info)) {
$video_cfg = empty($video_info['dv_platform']) ? null : json_decode($video_info['dv_platform'], 1);
}
//视频混剪模式
$video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/project');
$this->output['video_info'] = $video_info;
$this->output['use_platform'] = $use_platform;
$this->output['video_cfg'] = empty($video_cfg) ? null : $video_cfg;
$this->output['video_mixed_mode'] = $video_mixed_mode;
$this->output['font_map'] = (new App_Plugin_Ffmpeg_VideoPlugin())->getFontMap();
$color_list = plum_parse_config('color_list', 'config');
$this->output['color_list'] = $color_list;
//火山引擎、腾讯云配音
$huoshan_vcn = plum_parse_config('hsyq_vcn', 'system');
$tencent_vcn = plum_parse_config('txy_vcn', 'system');
$this->output['audio_vcn'] = empty($tencent_vcn) ? $huoshan_vcn : $tencent_vcn;
$this->output['platform_list'] = plum_parse_config('platform_list', 'dydqt/project');
$this->displaySmarty('dydqtshoppc/video/create-project.tpl');
}
/*
* 添加/编辑视频
*/
public function addVideoAction(){
$this->useLayout('dydqtshoppc-head.html');
$id = $this->request->getIntParam('id');
//获取视频信息
$Video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $Video_model->getRowByIdSid($id, $this->sid);
//视频混剪模式
$video_mixed_mode = plum_parse_config('project_mixed_mode','dydqt/pr
二、发布投放部分源代码示例
1..账号绑定一码多扫技术应用开发代码示例
代码如下(示例):
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
2.读入数据
定时挂载投放源代码示例
*/
//智能混剪模式1,删除视频素材
if ($item['dvm_video_mixed_mode'] == 1 && $item['dvm_material_type'] == 1) {
$file_path = PLUM_DIR_ROOT.$item['dvm_material_content'];
if (is_file($file_path)) {
unlink($file_path);
}
}
//视频素材删除ts素材
if ($item['dvm_material_type'] == 1) {
$file_path = PLUM_DIR_ROOT.$item['dvm_material_videots'];
if (is_file($file_path)) {
unlink($file_path);
}
}
//视频素材及图片素材删除,其他素材保留
if (in_array($item['dvm_material_type'], [1,3])) {
$video_meta_model->deleteById($item['dvm_id']);
}
}
}
}
$this->showAjaxResult($ret, '保存');
}
/*
* 保存场景
*/
public function saveSceneAction() {
$dv_id = $this->request->getIntParam('dv_id');
$scene = $this->request->getIntParam('scene');
if ($scene < 3 || $scene > 60) {
$this->displayJsonError('场景数,需介于3-60');
}
$video_model= new App_Model_Douyin_MysqlVideoStorage();
$video_item = $video_model->getRowByIdSid($dv_id, $this->sid);
if (empty($video_item)) {
$this->displayJsonError('参数错误');
}
$updata = [
'dv_video_use' => $scene,
];
$ret = $video_model->updateById($updata, $dv_id);
//更改场景组合数,则需要重新生成组合
if($video_item['dv_video_use'] != $scene){
//清空素材排列组合及缓存视频
$VideoMaterialPailie_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
$VideoMaterialPailie_model->clearPailie($dv_id);
//减少场景时清除视频素材
if ($scene < $video_item['dv_video_use']) {
//清除素材
$video_meta_model = new App_Model_Douyin_MysqlVideoMaterialStorage();
$vm_where = [
['name' => 'dvm_ds_id', 'oper' => '=', 'value' => $this->sid],
['name' => 'dvm_dv_id', 'oper' => '=', 'value' => $dv_id],
['name' => 'dvm_material_type', 'oper' => '=', 'value' => 1], //视频素材
['name' => 'dvm_scene', 'oper' => '>', 'value' => $scene],
];
$video_meta_list = $video_meta_model->getList($vm_where, 0, 0);
foreach ($video_meta_list as $item) {
$file_path = PLUM_DIR_ROOT.$item['dvm_material_videots'];
if (is_file($file_path)) {
unlink($file_path);
}
$video_meta_model->deleteById($item['dvm_id']);
}
}
}
$this->showAjaxResult($ret, '修改');
}
/*
* 素材类型输出
*/
private function output_materail_type($da_id, $type, $video_mode){
$material_model = new App_Model_Douyin_MysqlVideoMaterialStorage($this->sid);
$template_model = new App_Model_Douyin_MysqlVideoTempVideoStorage($this-