PHPackages                             ping-qu/transcode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ping-qu/transcode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ping-qu/transcode
=================

pingqu cloud transcode php library

1.0.3(8y ago)0395MITPHPPHP &gt;=5.3

Since Dec 6Pushed 8y ago5 watchersCompare

[ Source](https://github.com/ping-qu/transcode)[ Packagist](https://packagist.org/packages/ping-qu/transcode)[ RSS](/packages/ping-qu-transcode/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

### 接入概述

[](#接入概述)

1、到屏趣云后台申请access\_key和access\_secret

2、在屏趣云后台管理创建队列，创建转码模板和回调通知

3、安装转码sdk填入access\_key和access\_secret

4、提供回调地址，接收转码任务结果通知。依据接口文档实现业务逻辑

### 1、转码sdk的接入

[](#1转码sdk的接入)

#### 安装

[](#安装)

```
composer require ping-qu/transcode

```

#### 使用

[](#使用)

1、添加视频转码任务

```
 $client = new \Pingqu\Transcode('endpoint',access_key','access_secret');
 //endpoint填service.cloud.ping-qu.com

 $client->addVideoJob('objectKeyInput', 'objectKeyOutput', 'type', 'preset_id', 'pipeline_id');//添加视频转码任务

```

参数说明：

参数描述示例objectKeyInput输入文件video/test.mp4objectKeyOutput输出文件video/test.m3u8type转码类型mp4、m3u8preset\_id模板id，在屏趣云后台配置1pipeline\_id在屏趣云后台申请到的队列id1返回格式 array( 'message'=&gt;'', 'data'=&gt;'',//job\_id等信息 'errorId'=&gt;'', 'statusCode'=&gt;0 )

statusCode状态码表述

statusCode描述200成功400access\_key错误401签名失败422参数错误500内部服务器错误2、刷新转码

```
$client = new \Pingqu\Transcode('access_key','access_secret');
$client->transcodeAgain($job_id);

```

3、添加直播转码任务

```
$client = new \Pingqu\Transcode('access_key','access_secret');
$client->addLiveJob($preset_id_array);

```

其中$preset\_id\_array为模板数组，如果传空数组则不转码，1为默认模板，可以在屏趣云后台创建直播转码模板

返回格式：

```
array(
    'message'=>'',
    'data'=>array(
        'push_rtmp_url'=>'',
        'play_hls_history_url'=>'',
        'sessionid'=>'',
        'pull_audio_hls_url'=>'',
        'play_hls_url'=>'',
        'description'=>'',
        'job_id'=>'',
        'play_hls_url_tc'=>array();//转码后的url数组
    )
    'errorId'=>'',
    'statusCode'=>0
)
//php示例
array(){
  ["data"]=>
  array(8) {
    ["push_rtmp_url"]=>
    string(42) "rtmp://39.108.71.241/live/vBGV1wRiGwpx3E6e"
    ["play_hls_history_url"]=>
    string(87) "http://pingqu-test.oss-cn-shenzhen.aliyuncs.com/user/live/vBGV1wRiGwpx3E6e/history.m3u8"
    ["sessionid"]=>
    string(16) "vBGV1wRiGwpx3E6e"
    ["pull_audio_hls_url"]=>
    string(72) "http://pingqu-test.oss-cn-shenzhen.aliyuncs.com/user/hls_audio/live.m3u8"
    ["play_hls_url"]=>
    string(84) "http://pingqu-test.oss-cn-shenzhen.aliyuncs.com/user/live/vBGV1wRiGwpx3E6e/live.m3u8"
    ["description"]=>
    string(21) "this is a descriptoin"
    ["job_id"]=>
    int(207)
    ["play_hls_url_tc"]=>
    array(2) {
      [0]=>
      string(84) "http://pingqu-test.oss-cn-shenzhen.aliyuncs.com/user/live/vBGV1wRiGwpx3E6e/live.m3u8"
      [1]=>
      string(92) "http://pingqu-test.oss-cn-shenzhen.aliyuncs.com/user/live/vBGV1wRiGwpx3E6e_640x360/live.m3u8"
    }
  }
  ["errorId"]=>
  string(2) "OK"
  ["statusCode"]=>
  int(200)
}

```

### 2、转码回调

[](#2转码回调)

请求方式：post

参数描述job\_id转码任务idoutput\_file输出文件state转码状态，1成功，-1失败type文件类型duration时长input\_file输入文件signature签名你需要在接收回调的接口调用验证签名的方法

```
 $client = new \Pingqu\Transcode('endpoint',access_key','access_secret');
 $data = $client->getCallbackDate();

```

getCallbackData封装了回调验签

### 3、计费

[](#3计费)

屏趣云只负责转码，不负责存储转码后的文件，文件将按队列信息中填写的OSS信息上传到对应的OSS，屏趣云按转码文件流入大小收取转码费用。 [![image](https://camo.githubusercontent.com/f9520ea7dc8cd2bb0e61f21621219b90f678618ba9c817d9893047ae35c53c11/687474703a2f2f70696e6771752d746573742e6f73732d636e2d7368656e7a68656e2e616c6979756e63732e636f6d2f696d6167652f515132303137313231312d3136303631342e706e67)](https://camo.githubusercontent.com/f9520ea7dc8cd2bb0e61f21621219b90f678618ba9c817d9893047ae35c53c11/687474703a2f2f70696e6771752d746573742e6f73732d636e2d7368656e7a68656e2e616c6979756e63732e636f6d2f696d6167652f515132303137313231312d3136303631342e706e67)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity62

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

6

Last Release

3086d ago

Major Versions

0.0.1.x-dev → 1.0.02017-12-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20659595?v=4)[linyueb](/maintainers/linyueb)[@linyueb](https://github.com/linyueb)

### Embed Badge

![Health badge](/badges/ping-qu-transcode/health.svg)

```
[![Health](https://phpackages.com/badges/ping-qu-transcode/health.svg)](https://phpackages.com/packages/ping-qu-transcode)
```

###  Alternatives

[kaufmanndigital/cookieconsent

A ready-to-run Neos CMS Package, that adds Cookie Consent to your Neos-Site

1413.8k](/packages/kaufmanndigital-cookieconsent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
