PHPackages                             wanghouting/ltstream-php-ext - 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. wanghouting/ltstream-php-ext

ActiveTools

wanghouting/ltstream-php-ext
============================

ltstream php extension for laravel

v0.0.9(6y ago)4321MITPHPPHP ^7.0.3

Since Mar 2Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wanghouting/ltstream-php-ext)[ Packagist](https://packagist.org/packages/wanghouting/ltstream-php-ext)[ RSS](/packages/wanghouting-ltstream-php-ext/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

LOOTOM 流媒体服务第三方接入获取拉流url的laravel扩展
----------------------------------

[](#lootom-流媒体服务第三方接入获取拉流url的laravel扩展)

---

### 安装

[](#安装)

- composer:

    ```
    composer require wanghouting/ltstream-php-ext

    ```

### 配置

[](#配置)

1. 注册 ServiceProvider(laravel 5.5+版本不需要手动注册):

    ```
    LTStream\Extension\LaravelServiceProvider::class,

    ```
2. 发布配置文件:

    ```
    php artisan vendor:publish --provider="LTStream\Extension\LaravelServiceProvider"

    ```
3. 修改.env,增加:

    ```
    LTSTREAM_SERVER=平台地址:例如http://127.0.0.1:8091

    LTSTREAM_ACCESS_KEY=您的app_access_key

    LTSTREAM_SECRET=您的app_secret

    ```
4. 添加回调路由:

    ```
    Route::get('ltstream/callback','\LTStream\Extension\Controllers\LTStreamCallbackController@callback');

    ```

    注意路由地址要和在平台上注册填写的回调url保持一至，上面对应的是
5. 开始使用:

    ```
    $HttpFlvLiveUrl =   \LTStream\Extension\Facades\LTStream::getMainFlvLiveUrl($code);
    ```

    > 方法说明:

    - string getMainFlvLiveUrl($code) : 获取http-flv直播流主码流地址

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            http://192.168.88.103:8091/live/D24FF8DAF7334244AF4C8D57962AD798.flv?type=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfYWNjZXNzX2tleSI6IjNiOTlhYzg1YWM1MTRkZWQiLCJleHBpcmUiOjE1NTIyODU3MDU3OTcsIm5hbWUiOiLolbLmmKUifQ==.FxicWmq3z+JpkNrPa93c5YpEtVOm25h+LhF3HfM6jIY=

            ```
    - string getMainTsLiveUrl($code) : 获取http-ts直播流主码流地址

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            http://192.168.88.103:8091/live/D24FF8DAF7334244AF4C8D57962AD798.ts?type=1&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfYWNjZXNzX2tleSI6IjNiOTlhYzg1YWM1MTRkZWQiLCJleHBpcmUiOjE1NTIyODU3MDU3OTcsIm5hbWUiOiLolbLmmKUifQ==.FxicWmq3z+JpkNrPa93c5YpEtVOm25h+LhF3HfM6jIY=

            ```
    - string getSubFlvLiveUrl($code) : 获取http-flv直播流辅码流地址

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            http://192.168.88.103:8091/live/D24FF8DAF7334244AF4C8D57962AD798.flv?type=2&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfYWNjZXNzX2tleSI6IjNiOTlhYzg1YWM1MTRkZWQiLCJleHBpcmUiOjE1NTIyODU3MDU3OTcsIm5hbWUiOiLolbLmmKUifQ==.FxicWmq3z+JpkNrPa93c5YpEtVOm25h+LhF3HfM6jIY=

            ```
    - string getSubTsLiveUrl($code) : 获取http-ts直播流辅码流地址

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            http://192.168.88.103:8091/live/D24FF8DAF7334244AF4C8D57962AD798.ts?type=2&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBfYWNjZXNzX2tleSI6IjNiOTlhYzg1YWM1MTRkZWQiLCJleHBpcmUiOjE1NTIyODU3MDU3OTcsIm5hbWUiOiLolbLmmKUifQ==.FxicWmq3z+JpkNrPa93c5YpEtVOm25h+LhF3HfM6jIY=

            ```
    - mixed addMonitor($name,$path,$subPath,$address) : 添加监控设备(需要拥有添加权限)

        - 请求

            参数说明$name设备名称$path设备主码流地址$subPath设备辅码流地址$address设备地址
        - 返回值

            ```
            Array
            (
              [code] => 200
              [data] => Array
                  (
                      [address] => 123123
                      [code] => 08925c476fd14491881f354200101143
                      [online] => 1
                      [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                      [snapshot] =>
                      [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                  )

              [message] => 操作成功
            )

            ```

            返回值说明address设备地址code设备codeonline设备在线状态,0离线,1在线path设备主码流地址sub\_path设备辅码流地址snapshot设备快照
    - mixed updateMonitor($code,$name,$path,$subPath,$address) : 更新监控设备(需要拥有更新权限)

        - 请求

            参数说明$code设备code$name设备名称$path设备主码流地址$subPath设备辅码流地址$address设备地址
        - 返回值

            ```
            Array
            (
              [code] => 200
              [data] => Array
                  (
                      [address] => 123123
                      [code] => 08925c476fd14491881f354200101143
                      [online] => 1
                      [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                      [snapshot] =>
                      [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                  )

              [message] => 操作成功
            )

            ```

            返回值说明address设备地址code设备codeonline设备在线状态,0离线,1在线path设备主码流地址sub\_path设备辅码流地址snapshot设备快照
    - mixed getMonitorList() : 获取所有监控设备

        - 请求

            参数说明
        - 返回值

            ```
            Array
            (
                [code] => 200
                [data] => Array
                    (
                        [0] => Array
                            (
                                [address] => 办公室我的位置
                                [code] => D24FF8DAF7334244AF4C8D57962AD798
                                [online] => 1
                                [path] => rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/001
                                [snapshot] => 1
                                [sub_path] => /rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/002
                            )

                        [1] => Array
                            (
                                [address] => 123123
                                [code] => 70512aa7b93d444da89549386c8ae941
                                [online] => 1
                                [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                                [snapshot] =>
                                [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                            )

                        [2] => Array
                            (
                                [address] => 123123
                                [code] => 08925c476fd14491881f354200101143
                                [online] => 1
                                [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                                [snapshot] =>
                                [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                            )

                    )

                [message] => 操作成功
            )

            ```

            返回值说明address设备地址code设备codeonline设备在线状态,0离线,1在线path设备主码流地址sub\_path设备辅码流地址snapshot设备快照
    - mixed getMonitorPaginate($page = 1,$pageSize = 15) : 分页获取监控设备

        - 请求

            参数说明$page第几页 (默认1)$pageSize每页显示条数(默认15)
        - 返回值

            ```
            Array
            (
               [code] => 200
               [data] => Array
                   (
                       [list] => Array
                           (
                               [0] => Array
                                   (
                                       [address] => 办公室我的位置
                                       [code] => D24FF8DAF7334244AF4C8D57962AD798
                                       [online] => 1
                                       [path] => rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/001
                                       [snapshot] => 1
                                       [sub_path] => /rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/002
                                   )

                               [1] => Array
                                   (
                                       [address] => 123123
                                       [code] => 70512aa7b93d444da89549386c8ae941
                                       [online] => 1
                                       [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                                       [snapshot] =>
                                       [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                                   )

                               [2] => Array
                                   (
                                       [address] => 123123
                                       [code] => 08925c476fd14491881f354200101143
                                       [online] => 1
                                       [path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/001
                                       [snapshot] =>
                                       [sub_path] => rtsp://admin:12345678q@192.168.88.111:554/Streaming/Channels/002
                                   )

                           )

                       [total] => 3
                   )

               [message] => 操作成功
            )

            ```

            返回值说明total设备总数address设备地址code设备codeonline设备在线状态,0离线,1在线path设备主码流地址sub\_path设备辅码流地址snapshot设备快照
    - deleteMonitor ($code) 删除设备(需要拥有删除权限)

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            Array
            (
                [code] => 200
                [data] => null
                [message] => 操作成功
            )

            ```
    - getMonitorInfo ($code) 获取设备详细信息

        - 请求

            参数说明$code设备code
        - 返回值

            ```
            Array
            (
              [code] => 200
              [data] => Array
                  (
                      [address] => 办公室我的位置
                      [code] => D24FF8DAF7334244AF4C8D57962AD798
                      [online] => 1
                      [path] => rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/001
                      [snapshot] => 1
                      [sub_path] => /rtsp://admin:12345678q@192.168.88.164:554/Stream/Channels/002
                  )

              [message] => 操作成功
            )

            ```

            返回值说明address设备地址code设备codeonline设备在线状态,0离线,1在线path设备主码流地址sub\_path设备辅码流地址snapshot设备快照

### 功能清单

[](#功能清单)

- 支持http-flv直播;
- 支持http-ts直播;
- 支持主流/辅流;
- 支持按需拉流;

### 状态码说明

[](#状态码说明)

状态码说明200ok400非法的请求地址404请求的地址不存在500服务器异常1001无效的签名（signature）1002签名已过期1003appAccessKey和appSecret不正确1004第三方回调url请求超时1005第三方回调url返回拒绝1006第三方被禁用1101生成token失败1102无效的token1103token已过期1201未找到码流地址1202拉流失败2001请求参数有误2002权限不足

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

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 ~16 days

Recently: every ~30 days

Total

9

Last Release

2502d ago

PHP version history (2 changes)v0.0.1PHP ^7.1.3

v0.0.6PHP ^7.0.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a35f6a2cb4ad6958877e4b546a24de75b6561d94ec25b9c5fac509c0e58effd?d=identicon)[wanghouting](/maintainers/wanghouting)

---

Top Contributors

[![wanghouting](https://avatars.githubusercontent.com/u/11710486?v=4)](https://github.com/wanghouting "wanghouting (9 commits)")[![wanghouting123](https://avatars.githubusercontent.com/u/20196935?v=4)](https://github.com/wanghouting123 "wanghouting123 (6 commits)")

### Embed Badge

![Health badge](/badges/wanghouting-ltstream-php-ext/health.svg)

```
[![Health](https://phpackages.com/badges/wanghouting-ltstream-php-ext/health.svg)](https://phpackages.com/packages/wanghouting-ltstream-php-ext)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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