承接 escolalms/video 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

escolalms/video

最新稳定版本:0.0.23

Composer 安装命令:

composer require escolalms/video

包简介

Escola Headless LMS Video Processing

README 文档

README

codecov phpunit downloads downloads downloads

What does it do

Coverts TopicVideo into HLS stream.

Installing

  • composer require escolalms/video

Requirements

  • ffmpeg must be installed
  • Once EscolaLms\TopicType\TopicTypeChanged is dispatched job ProccessVideo added to queue

Configuration

You can configure the quality and resolution of the processed video by setting values in config.php file under the bitrates key. The key takes arrays of values.

  • kiloBitrates parameter is responsible for the video quality.
  • scale parameter is responsible for video resolution, setting this parameter may cause video distortion.

You can also disable video processing or change the drive.

Example config:

return [
    'disk' => env('VIDEO_DISK', config('filesystems.default')),
    'enable' => env('VIDEO_PROCESSING_ENABLE', true),
    'bitrates' => [
        [
            'kiloBitrate' => 250, // video quality
            'scale' => '640:480' // This parameter changes the video resolution. You can omit this parameter.
        ],
        ...
    ]
];

Example

This package extends API resources in EscolaLms\TopicType package.

  • \EscolaLms\TopicTypes\Http\Resources\TopicType\Client\VideoResource - replaces value and url fields with hls values
{
  "id": 1,
  "value": "course/1/topic/1/video/hls.m3u8",
  "url": "https://escolalms.com/course/1/topic/1/video/hls.m3u8"
}
  • \EscolaLms\TopicTypes\Http\Resources\TopicType\Admin\VideoResource - adds hls values
{
  "id": 1,
  "value": "course/1/topic/1/video/video.mp4",
  "url": "https://escolalms.com/course/1/topic/1/video/video.mp4",
  "hls": "course/1/topic/1/video/hls.m3u8",
  "hls_url": "https://escolalms.com/course/1/topic/1/video/hls.m3u8"
}

The processing status is saved in the json field in the topics table:

  • Processing successful
{
  "ffmpeg": {
    "state": "finished",
      "path": "course/1/topic/1/video/hls.m3u8"
  }
}
  • Processing failed
{
  "ffmpeg": {
    "state" : "error",
    "message" : "Unable to probe /path/video.mp4"
  }
}

Tests

Run ./vendor/bin/phpunit to run tests. See tests folder as it's quite good staring point as documentation appendix.

Test details codecov phpunit

Events

  1. ProcessVideoStarted - event dispatched after processing started
  2. ProcessVideoFailed - event dispatched after processing failed

统计信息

  • 总下载量: 11.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固