一、短视频矩阵系统一般拥有以下几个主要功能:
1. 视频拍摄和剪辑功能,让用户轻松制作和发布短视频内容。
2. 视频分发和推广功能,矩阵管理发布、将制作好的短视频内容推送到各大短视频平台,实现效果最大化。
3. 数据监测和分析功能,对短视频内容的播放量、互动等数据进行监测和分析,帮助用户优化短视频内容。
4. 社交功能,收录意向线索、让短视频制作者和客户间进行互动,增加内容的粘性和互动性。 智能收录意向线索触达变现。
二、部分源代码实时在线分享:
$type_list_single = array_column($type_list,'title','type');
$this->output['now_type'] = $type;
$this->output['type_list'] = $type_list;
$this->output['type_list_single'] = $type_list_single;
//获取素材组合信息
$pailie_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
$pailie_row = $pailie_model->getRowByDvid($da_id);
$pailie_row['dvmp_pailie_have'] = $pailie_row['dvmp_total']-$pailie_row['dvmp_used'];
//视频混剪模式
$this->output['pailie_row'] = $pailie_row;
$this->output['temp_video_count'] = $temp_video_count;
$this->output['project_mode'] = plum_parse_config('project_mixed_mode','dydqt/project')[$video_mode];
//输出操作指引
$index = [
1 => [
'order' => 1,
'title' => '视频素材',
'desc' => '根据混剪模式,必须上传',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=1",
],
2 => [
'order' => 2,
'title' => '音频素材',
'desc' => '背景音与文案配音,可二选一',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=2",
],
3 => [
'order' => 3,
'title' => '标题素材',
'desc' => '视频上半部分的标题,可不传',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=4",
],
4 => [
'order' => 4,
'title' => '文案素材',
'desc' => '视频下半部分的文案,可不传',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=5",
],
];
if ($video_mode == 11) {
$index[1] = [
'order' => 1,
'title' => '图片素材',
'desc' => '根据混剪模式,必须上传',
'url' => "/dydqtshoppc/video/materialList?dv_id={$da_id}&type=3",
];
}
$this->output['oper_index'] = $index;
}
/*
* 素材管理
*/
public function materialListAction(){
//面包屑
$breadcrumbs = [
['title' => '视频管理', 'link' => '/video/videoList'],
['title' => '素材管理', 'link' => '#'],
];
$this->buildBreadcrumbs($breadcrumbs);
$dv_id = $this->request->getIntParam('dv_id'); //活动ID
$type = $this->request->getIntParam('type',0); //素材类型
$keyword_type = $this->request->getStrParam('keyword_type');
$keyword = $this->request->getStrParam('keyword');
$scene = $this->request->getIntParam('scene',0);
//获取视频信息
$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; //默认为视频素材类型
}
三、短视频矩阵系统前端代码如何实现框架:
短视频矩阵系统的前端框架语言包括但不限于JavaScript、HTML、CSS等常见的Web技术语言。其中,JavaScript作为客户端脚本语言,主要用于实现互动效果和动态交互;HTML用于构建网页结构和元素的布局;CSS则负责网页的样式设计和布局排版。此外,短视频矩阵系统还可能采用Vue.js、React、Angular等流行的前端框架来简化开发流程和提高页面性能。
源代码:
ase 4: //场景组合
if($video_info['dv_video_mode']==2){
$maxnum = 1000;//该原声模式下,视频数量最多为10个
}else{
$maxnum = 4000;//该配声模式下,视频数量最多为40个
}
$min_video_count = $maxnum - count($have_video_list); //本次上传至少还需要多少个视频
if(count($attachment_list) > $min_video_count){
$this->displayJsonError("该模式下最多可上传{$maxnum}个视频素材,本次请最多上传{$min_video_count}个视频");
}
if(count($have_video_list) >= $maxnum){
$this->displayJsonError("该模式下只能上传{$maxnum}个视频素材");
}
//智能组合(原声)、智能组合(配声)视频限制5秒以内
foreach ($attachment_list as $video_item){
if(floor($video_item['dsa_duration']) > 15){
$this->displayJsonError('该模式下请使用15秒及以内的短视频');
}
}
break;
case 3: //随机选定
//该模式下,视频长度不限,视频数量越多越好,不做限制
foreach ($attachment_list as $video_item){
if(floor($video_item['dsa_duration']) < 15 || floor($video_item['dsa_duration']) > 60){
$this->displayJsonError('该模式下请使用15~60秒的视频素材');
}
}
break;
}
} elseif ($sc_type == 'audio') {//音频素材
//智能组合(原声)、智能组合(配声)视频限制5秒以内
foreach ($attachment_list as $item){
if(floor($item['dsa_duration']) < $video_info['dv_video_duration']){
#$this->displayJsonError('该模式下需要的音频素材不应短于预计合成短视频长度');
}
}
} elseif ($sc_type == 'image') {//图片素材
//目前仅支持jpg图片,png图片需要转码
foreach ($attachment_list as $key => &$item) {
list(,,$image_type) = getimagesize(PLUM_DIR_ROOT.$item['dsa_path']);
//仅接受jpg,png
if (!in_array($image_type, [2,3])) {
unset($attachment_list[$key]);
continue;
}
//png图片转码
if ($image_type == 3) {
$jpg_file = pathinfo($item['dsa_path'], PATHINFO_DIRNAME)."/".pathinfo($item['dsa_path'], PATHINFO_FILENAME).".jpg";
$png_image = imagecreatefrompng(PLUM_DIR_ROOT.$item['dsa_path']);
$bg_image = imagecreatetruecolor(imagesx($png_image), imagesy($png_image));
imagefill($bg_image, 0, 0, imagecolorallocate($bg_image, 255, 255, 255));
imagealphablending($bg_image, true);
imagecopy($bg_image, $png_image, 0, 0, 0, 0, imagesx($png_image), imagesy($png_image));
imagedestroy($png_image);
$quality = 60;
imagejpeg($bg_image, PLUM_DIR_ROOT.$jpg_file, $quality);
imagedestroy($bg_image);
$item['dsa_path'] = $jpg_file;
}
}
}
//保存
$dvm_id_list = []; //保存的所有素材列表
foreach ($attachment_list as $each){
$material_data = [
'dvm_aa_id' => $this->manager['ds_agent_id'],
'dvm_ds_id' => $this->sid,
'dvm_dv_id' => $video_info['dv_id'],
'dvm_material_name' => $each['dsa_real_name'],
'dvm_material_type' => $mt_type,
'dvm_material_content' => $each['dsa_path'],
'dvm_video_mixed_mode' => $video_info['dv_video_mode'],
'dvm_video_is_deal' => ($sc_type == 'video' && $video_info['dv_video_mode'] != 3) ? 0 : 1,
'dvm_update_time' => time(),
'dvm_width' => $each['dsa_width'],
'dvm_height' => $each['dsa_height'],
'dvm_duration' => $each['dsa_duration'],
'dvm_scene' => $scene > 0 ? $scene : 1,//默认场景1
'dvm_related_aid' => $each['dsa_id'],
'dvm_create_time' => time(),
];
$dvm_id = $videvo_material_model->insertValue($material_data);
array_push($dvm_id_list, $dvm_id);
}
//清空素材排列组合(视频及图片素材,背景图片不处理)
if (in_array($sc_type, ['video', 'image']) && in_array($mt_type, [1,3])) {
$VideoMaterialPailie_model = new App_Model_Douyin_MysqlVideoMaterialPailieStorage();
$VideoMaterialPailie_model->clearPailie($video_info['dv_id']);
//后台进程对视频进行剪辑处理
if (in_array($video_info['dv_video_mode'], [1,2,4])) {
foreach ($dvm_id_list as $dvm_id_item){
plum_open_backend('douyinvideo','dealUploadMaterialVideo',['dvm_id'=>$dvm_id_item, 'shot'=>$video_info['dv_video_shot']]);
}
}
}
$this->displayJsonSuccess([],true,'保存成功');
}
/*
* 生成素材视频组合
*/
public function zuheMaterialAction(){
//获取视频信息
$dv_id = $this->request->getIntParam('dv_id');
$video_model = new App_Model_Douyin_MysqlVideoStorage();
$video_info = $video_model->getRowByIdSid($dv_id, $this->sid);
if(empty($video_info)){
$this->displayJsonError('该视频不存在');
}
//初次遍历,验证数据完整性
$videoMaterial_model = new App_Model_Douyin_MysqlVideoMaterialStorage();
switch ($video_info['dv_video_mode']) {
case 1: //智能混剪
case 2: //随机组合
case 3: //随机选定
$have_video_list = $videoMaterial_model->getCreateVideoMaterials($this->sid, $dv_id,1,$video_info['dv_video_mode'],1);
if(count($have_video_list) < $video_info['dv_video_use']){
$this->displayJsonError("生成失败,当前模式下视频素材数量至少为{$video_info['dv_video_use']}个");
}
break;
case 4: //场景组合
//获取当前模式下已有的视频列表
$have_video_list = $videoMaterial_model->getCreateVideoMaterials($this->sid, $dv_id,1,$video_info['dv_video_mode'],1);
$scene = [];
$scene_total = 1;
foreach($have_video_list as $k=>$v){
$scene[$v['dvm_scene']][] = $have_video_list[$k]['dvm_id'];
}
for ($i=1; $i<=$video_info['dv_video_use']; $i++) {
if (empty($scene[$i])) {
$this->displayJsonError("生成失败,当前模式下场景{$i}视频素材不存在");