php 七牛云视频/图片转码保存 saveas

2023-08-06  本文已影响0人  galenv

function saveas() {

$accessKey =$this->config['accessKey'];

    $secretKey =$this->config['secretKey'];

    $auth =new Auth($accessKey, $secretKey);

//资源路径    

$key='';

    # 另存操作的目标空间与资源名

    $entryURI =$this->config['bucket'].":test.m3u8";

    // 要转码的文件所在的空间

    $bucket =$this->config['bucket'];

    // 转码是使用的队列名称

        $pipeline ='';

        $pfop =new PersistentFop($auth,new config());

        // 要进行转码的转码操作

      $fops ='avthumb/m3u8/noDomain/1/segtime/15/vb/240k';

      // 可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当间

        $savekey = \Qiniu\base64_urlSafeEncode($bucket.':test.m3u8');

        $fops =$fops.'|saveas/'.$savekey;

      // list($id, $err) = $pfop->execute($key, $fops);

        $res=$pfop->execute($bucket,$key,$fops,null,"***");

        echo "\n====> pfop avthumb result: \n";

        var_dump($res);

}

上一篇 下一篇

猜你喜欢

热点阅读