martin1982 / live-broadcast-bundle
Bundle for live-streaming to various online networks
Installs: 2 440
Dependents: 2
Suggesters: 0
Security: 0
Stars: 46
Watchers: 6
Forks: 19
Open Issues: 7
Type:symfony-bundle
Requires
- php: >=8.0
- ext-fileinfo: *
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.7
- google/apiclient: ^2.7
- google/apiclient-services: *
- martin1982/facebook-graph-sdk: ^7.0.1
- psr/log: ^3.0
- react/event-loop: ^1.1
- symfony/console: ^5.4|^6.0
- symfony/framework-bundle: ^5.4|^6.0
- symfony/http-kernel: ^5.4|^6.0
- symfony/messenger: ^5.4|^6.0
- symfony/monolog-bundle: ^3.5
- symfony/validator: ^5.4|^6.0
- symfony/yaml: ^5.4|^6.0
Requires (Dev)
- doctrine/doctrine-migrations-bundle: ^3.0
- escapestudios/symfony2-coding-standard: ^3.1
- friendsofphp/php-cs-fixer: ^3.6
- guzzlehttp/guzzle: ^7.0
- phpmd/phpmd: ^2.12
- phpunit/phpunit: ^9.0|^10.0
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.5
Suggests
- doctrine/doctrine-migrations-bundle: Keep track of updated entities in your database
- dev-master
- v7.0.5
- v7.0.4
- v7.0.3
- v7.0.2
- v7.0.1
- v7.0.0
- v6.0.0
- v5.1.1
- v5.1.0
- v5.0.0
- v4.1.1
- v4.1.0
- v4.0.9
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v0.8.0
- v0.7.8
- v0.7.7
- v0.7.6
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.16
- v0.5.15
- v0.5.14
- v0.5.13
- v0.5.12
- v0.5.11
- v0.5.10
- v0.5.9.1
- v0.5.9
- v0.5.8
- v0.5.8-alpha
- v0.5.7
- v0.5.7-alpha
- v0.5.6-alpha
- v0.5.5-alpha
- v0.5.4
- v0.5.4-alpha
- v0.5.3-alpha
- v0.5.2-alpha
- v0.5.1-alpha
- v0.5.0-alpha
- v0.4.5-alpha
- v0.4.4-alpha
- v0.4.3-alpha
- v0.4.2-alpha
- v0.4.1-alpha
- v0.4.0-alpha
- v0.3.3-alpha
- v0.3.2-alpha
- v0.3.1-alpha
- v0.3.0-alpha
- v0.2.1-alpha
- v0.2.0-alpha
- v0.1.2-alpha
- v0.1.1-alpha
- v0.1.0-alpha
This package is auto-updated.
Last update: 2024-11-18 06:34:09 UTC
README
Table of contents
- About
- Prerequisites
- Basic installation
- Enabling Facebook Live
- Enabling YouTube Live
- Add new output platforms
- Using an admin GUI
About
The Live Broadcast Bundle will make it possible to plan live video streams to various websites/apps like Twitch, YouTube Live, Facebook Live.
You are able to stream from various inputs. This package supports files, URLs 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
To test these prerequisites the Symfony command livebroadcaster:test:shell
can be used after the installation described below.
If you like to check this manually the Broadcaster needs a few commands on an operating system;
All OS's:
ffmpeg 3.x or higher
On Linux:
ps
kill
On Mac:
ps
grep
kill
On Windows:
tasklist
taskkill
Basic installation
This bundle is available on Packagist. You can then install it using Composer:
$ composer require martin1982/live-broadcast-bundle
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 bin/console livebroadcaster:broadcast
To run the scheduler as a long-running process it's recommended to use the messenger middleware to keep the database connection alive as described at https://symfony.com/doc/current/messenger.html
FFMpeg log directory
To view the output of FFMpeg you need to configure a log directory in your config/packages/live_broadcast.yaml
.
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
Set up the following config for thumbnails:
live_broadcast:
thumbnail:
upload_directory: '%kernel.project_dir%/public/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 config/packages/live_broadcast.yaml
with the following configuration:
live_broadcast:
facebook:
application_id: YourFacebookAppId
application_secret: YourFacebookAppSecret
Enabling YouTube Live
Login to https://console.developers.google.com/ and enable the 'YouTube Data API v3'.
Add the YouTube API info to your config.yml:
live_broadcast:
youtube:
client_id: YourGoogleOauthClientId
client_secret: YourGoogleOauthClientSecret
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 config/services.yml
live.broadcast.output.new:
class: Martin1982\LiveBroadcastBundle\Service\StreamOutput\OutputNew
tags:
- { name: live.broadcast.output, platform: 'New' }
Using an admin GUI
This bundle comes without a web frontend interface, to make use of an admin package you can pick the one to your liking;
- Sonata Admin: https://github.com/Martin1982/live-broadcast-sonata-admin-bundle
- Easyadmin: https://github.com/Martin1982/live-broadcast-easyadmin-bundle