定制 xmon/sonata-media-provider-video-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xmon/sonata-media-provider-video-bundle

Composer 安装命令:

composer require xmon/sonata-media-provider-video-bundle

包简介

This bundle extends providers Sonata Media Bundle, creates a new provider for uploading videos and use FFmpeg

README 文档

README

The SonataMediaProviderVideoBundle extends providers SonataMediaBundle, creates a new video provider for uploading videos, generate thumbnail and use FFmpeg.

This Bundle is based on sergeym/VideoBundle, this Fork and the rest of the Forks of the main project appear to be abandoned and I have made many changes, so I decided to create a new functional and documented project.

Requirements

You need install ffmpeg in your server.

Installation

First you need install phansys/getid3 dependency

$ php composer.phar require phansys/getid3:~2.1@dev

There are a problem installing from composer.json of this bundle, issue #16

Install this bundle

$ php composer.phar require xmon/sonata-media-provider-video-bundle 

Add VideoBundle to your application kernel

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Xmon\SonataMediaProviderVideoBundle\XmonSonataMediaProviderVideoBundle(),
        // ...
    );
}

Configuration example

fter installing the bundle, make sure you configure these parameters

xmon_sonata_media_provider_video:
    ffmpeg_binary: "/usr/local/bin/ffmpeg" # Required, ffmpeg binary path
    ffprobe_binary: "/usr/local/bin/ffprobe" # Required, ffprobe binary path
    binary_timeout: 60 # Optional, default 60
    threads_count: 4 # Optional, default 4
    config:
        image_frame: 5 # Optional, default 10, Can not be empty. Where the second image capture
        video_width: 640 # Optional, default 640, Can not be empty. Video proportionally scaled to this width
    formats:
        mp4: true # Optional, default true, generate MP4 format
        ogg: true # Optional, default true, generate OGG format
        webm: true # Optional, default true, generate WEBM format

Twig usage

For printing the URLs of the converted videos that have been saved in the metadata field, I have created 3 twig filters

{{ media|video_mp4 }}
{{ media|video_ogg }}
{{ media|video_webm }}

Credits

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 4
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固