多账号矩阵管理系统技术嫁接开发源代码

多账号矩阵管理系统技术嫁接开发源代码

文章目录

  • 一、剪辑部分源代码开发示例
  • 二、发布投放部分源代码示例
    • 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-

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值