55
HIGH QUALITY LIVE BROADCASTING WITH PHP by Martin de Keijzer PHP Limburg BE - July 27, 2016

High quality live broadcasting with PHP 27 07-2016

Embed Size (px)

Citation preview

Page 1: High quality live broadcasting with PHP 27 07-2016

HIGH QUALITY LIVE BROADCASTING WITH PHP

by Martin de KeijzerPHP Limburg BE - July 27, 2016

Page 2: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

ABOUT ME

Martin de KeijzerDutch web developer

Working @ Spinnin' Records

PHPBenelux Board Member

@Martin1982

http://www.martindekeijzer.nl

Page 3: High quality live broadcasting with PHP 27 07-2016
Page 4: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

We digital

Page 5: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

TODAY

Page 6: High quality live broadcasting with PHP 27 07-2016

LIVE STREAMINGWhy and when?

Page 7: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

LIVING ON THE EDGE

Live streaming is all about bringing the latest and greatest

Page 8: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

VIRTUAL PRESENCE

Page 9: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

DIRECT FEEDBACK

Every modern live streaming service has a chat for direct feedback

Page 10: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

LIKE IN THE OLD DAYS

Page 11: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

BENEFITS AND USAGES

• More followers

• Create hype

• Product presentations

• Screencasts

Page 12: High quality live broadcasting with PHP 27 07-2016

THE SPINNIN' HISTORYWhy the tech dept. stepped in

Page 13: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

SPINNIN' SESSIONS

Weekly premiere on Twitch

Page 14: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

Page 15: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

Ingredient 1; An MP4 file

Page 16: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

Ingredient 2: An old Windows desktop

Page 17: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

Ingredient 3: Open Broadcaster Software

Page 18: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

Ingredient 4: A human being at the controls

Page 19: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE TECHNOLOGY

What could possibly go wrong?

Page 20: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE RESULT

Page 21: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE RESULT

The good: People were eager to hear the radio show early

Page 22: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE RESULT

The bad: We were struggling with technology to deliver on time

Page 23: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

THE RESULT

The ugly: Jenny got frustrated by technology issues and viewers start complaining in chat

Page 24: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OTHER COMPLICATIONS

Bandwidth when sending a stream to multiple social networks

Page 25: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OTHER COMPLICATIONS

Power outages

Page 26: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OTHER COMPLICATIONS

Technical knowledge about accepted stream settings

Page 27: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OTHER COMPLICATIONS

Manually starting streams for timezone targeting

Page 28: High quality live broadcasting with PHP 27 07-2016

LIVE BROADCAST BUNDLEThe path to salvation

Page 29: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

GET IT TODAY

Demo project:git clone [email protected]:Martin1982/live-broadcast-demo.git

Runs with SQLite / Local php server

Page 30: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

SUPPORT

Page 31: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

GET IT TODAY

composer require martin1982/live-broadcast-bundle

Just the bundle:

Still in alpha; we release early & often

Page 32: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

HIGH LEVEL OVERVIEW

Input

FileUrl

RTMP

Processing

Database FFMPEGOS PID's

Twitch

Facebook

Youtube

Twitch

Outputs

Page 33: High quality live broadcasting with PHP 27 07-2016

INSIDE THE BUNDLECreated for extensibility

Page 34: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

SCHEDULER

• Retrieves the LiveBroadcast entities

• Checks running broadcasts

• Decides to start/stop or leave a broadcast alone

Page 35: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

I/O STREAM SERVICES

Converts the Input and Channel entities to input and output parameters for FFMpeg

Page 36: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

ENTITIESInput

One of File / URL or RTMP

LiveBroadcast

Title, description,Start & end time,

Stop stream when end time is reached

Channel

Facebook YouTubeTwitch

Page 37: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

INPUTFile

Local file locationFor prerecorded video

Page 38: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

INPUT

Direct url location for prerecorded video

URL

Page 39: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

INPUTRTMP(soon)

Live video input protocolGreat for broadcasting to multiple channels from

a lower bandwidth location.

Page 40: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

INPUT DEEP-DIVE

Page 41: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

PROCESSING

Database Is being visited by the scheduler to seeif a broadcast needs to run or stop

The core command for reading input mediaand sending it to one of the output channelsFFMPEG

OSProcess list is being checked by the scheduler

to see which broadcasts from the bundle are runningand what their PID's are

Page 42: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUTTwitch

Configurable with a stream key from the Twitchdashboard

Page 43: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUT

Needs a reviewed Facebook app to run and allow API calls

Facebook

Page 44: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUTYouTube

(in active development)

Needs to authenticate an app for doingAPI calls

Page 45: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUTYour channel

Needs to be coded by you

Page 46: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUT ENTITY

Page 47: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

OUTPUT SERVICE

Page 48: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

BONUS: ADMIN

Spinnin' uses Sonata, so we added it as a bonus and a fullsetup in a demo project which you can use to test-drive

the application

Page 49: High quality live broadcasting with PHP 27 07-2016

THE ROAD AHEADCurrent and future goals

Page 50: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

MORE INPUTS

Mainly RTMP, as easy and functional as possible

Ideas are going around to combine graphic layers to a single video stream output

Page 51: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

MORE CHANNELS

YouTube Live streaming is high on the priority list.

Page 52: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

MORE QUALITY

Firmly tested code, good documentation and easier implementation.

Page 53: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

IN CONCLUSIONLive broadcasting on a professional level is hard

Bandwidth may be your enemy on remote locations

Broadcasting consists of input, processing and outputTwitch and Facebook are already there, with Youtube soon to follow

More inputs will be added shortly

Spinnin' Records invested time and resources to give thisaway for free, when fixing or adding stuff a PR is much appreciated

Page 54: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

LIVE DEMO TIME?

Page 55: High quality live broadcasting with PHP 27 07-2016

A presentation by Martin de Keijzer

Thank you for listening,any questions?