martin1982 / live-broadcast-easyadmin-bundle
Easyadmin plugin for the live broadcast bundle
Installs: 18
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.4|>=8.0
- ext-fileinfo: *
- easycorp/easyadmin-bundle: ^3.0|^4.0
- martin1982/live-broadcast-bundle: dev-master
- symfony/framework-bundle: ^4.4|^5.4|^6.0
- symfony/mime: ^4.4|^5.4|^6.0
Requires (Dev)
- doctrine/doctrine-migrations-bundle: ^2.1|^3.0
- escapestudios/symfony2-coding-standard: ^3.1
- friendsofphp/php-cs-fixer: ^3.0
- guzzlehttp/guzzle: ^7.0
- php-mock/php-mock-phpunit: ^2.6
- phpunit/phpunit: ^9.1
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-11-11 13:57:54 UTC
README
Table of contents
- About
- Prerequisites
- Basic installation
- Enabling Facebook Live
- Enabling YouTube Live
- Add new output platforms
About
The Live Broadcast Bundle will make it possible to plan live video streams to various channels like Twitch, YouTube Live, Facebook Live (referred to as Output or Channels).
As "Input" we support files, URL's or existing RTMP streams.
For more info you can view the latest recorded presentation below, check the demo project at https://github.com/Martin1982/live-broadcast-demo or read on;
Prerequisites
The Broadcaster needs a few commands;
ffmpeg 3.x or higher
On Linux:
ps
kill
On Mac:
ps
grep
kill
On Windows:
tasklist
taskkill
To test these prerequisites the Symfony command livebroadcaster:test:shell
can be used after the installation described below.
Basic installation
This bundle will be made available on Packagist. You can then install it using Composer:
$ composer require martin1982/live-broadcast-bundle
Next, for Symfony < 4 enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Martin1982\LiveBroadcastBundle\LiveBroadcastBundle(), ); }
Use Doctrine to update your database schema with the broadcasting entities, when upgrading it is recommended to use migrations.
To start the broadcast scheduler you can run the following command:
$ php app/console livebroadcaster:broadcast
To make broadcast planning available through an admin interface we've added support for the Sonata Admin bundle.
FFMpeg log directory
To view the output of FFMpeg you need to configure a log directory in your app/config/config.yml
.
live_broadcast:
ffmpeg:
log_directory: '%kernel.logs_dir%'
Event loop
You can use this configuration to set the event loop timer:
live_broadcast:
eventloop:
timer: 5
Thumbnailer setup
Setup the following config for thumbnails:
live_broadcast:
thumbnail:
upload_directory: '%kernel.root_dir%/../web/uploads/thumbnails'
web_path: '/uploads/thumbnails'
Enabling Facebook Live
Create a Facebook app on https://developers.facebook.com with the following permissions:
- user_videos
- user_events
- user_managed_groups
- manage_pages
- publish_actions
- Live-Video API
Edit your app/config/config.yml
with the following configuration:
live_broadcast:
facebook:
application_id: YourFacebookAppId
application_secret: YourFacebookAppSecret
When using Sonata Admin; add the Sonata block to your blocks config:
sonata_block:
blocks:
sonata.block.service.facebookauth:
contexts: [admin]
Enabling YouTube Live
Login to https://console.developers.google.com/ and enable the 'YouTube Data API v3'.
Setup oAuth Credentials for your server. In case you're using the Sonata Admin from this
bundle the redirect URI's path is <your domain>/admin/channel/youtube/oauthprovider
Add the YouTube API info to your config.yml:
live_broadcast:
youtube:
client_id: YourGoogleOauthClientId
client_secret: YourGoogleOauthClientSecret
redirect_route: admin_martin1982_livebroadcast_channel_abstractchannel_youtubeoauth
When using Sonata Admin; add the Sonata block to your blocks config:
sonata_block:
blocks:
sonata.block.service.youtubeauth:
contexts: [admin]
Add these lines to your parameters.yml (used for generating a thumbnail URL)
parameters:
router.request_context.host: broadcast.com
router.request_context.scheme: https
Add new output platforms
Create a new Channel Entity in Entity/Channel that extends the AbstractChannel (e.g. ChannelNew)
Create a new StreamOutput service in Service/StreamOutput that implements the OutputInterface (e.g. OutputNew)
Configure the service with the output tag in Resources/config/services.yml
live.broadcast.output.new:
class: Martin1982\LiveBroadcastBundle\Service\StreamOutput\OutputNew
tags:
- { name: live.broadcast.output, platform: 'New' }
To add support for Sonata admin; add a new form for the Channel in Admin/ChannelAdmin.php
protected function configureFormFields(FormMapper $formMapper) { if ($subject instanceof ChannelNew) { $formMapper->add('...', 'text', array('label' => '...')); } }
Next add the sub class for the channelAdmin in Resources/config/admin.yml for
sonata.admin.channel
calls:
- [setConfiguredSubclasses, [ { "Name": Martin1982\LiveBroadcastBundle\Entity\Channel\ChannelNew } ] ]