SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Video Streaming
Rafael Bagagem Henriques
rhenriques@ipfn.ist.utl.pt

e-lab
Instituto Superior Técnico
Lisboa, Portugal
http://elab.ist.utl.pt

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Streaming multimedia
●

●
●

Multimedia that is constantly received by, and
normally displayed to, the end-user
A media stream can be on demand or live
Usually applied to media that are distributed
over telecommunications networks
—

●

Real world examples
—

2

Radio and TV are inherently streaming
Youtube, on-line TV and Radios, etc.

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
OSI Model
●

3

A set of seven layers that define the different stages
that data must go through to travel from one device to
another over a network

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
OSI Model – layers and
instances
●

●

4

Layer – a collection of conceptually similar functions that provide
services to the layer above and receives service from the layer below.
Instance – on each layer an instance provides services to the
instances at the layer above and requests service from the layer
below; conceptually two instances at one layer are connected by a
horizontal protocol connection on that layer.

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
OSI Model – layers
description
●

●

●

●

5

Physical Layer – electrical and physical
specifications (layout of pins, voltages, cable
specifications, hubs, network adapters …
Data Link Layer – functional and procedural means
to transfer data; detect/correct errors on Physical.
Network Layer – functional and procedural means
of transferring variable length data via one or more
networks; performs network routing functions;
perform fragmentation/reassembly, and report
delivery errors; maintain the QoS requested by the
Transport.
Transport Layer – provides transparent transfer of
data between end users, providing reliable data
transfer services to upper layers; controls reliability
of a given link through flow control, segmentation
and de-segmentation, and error control; keep track
of the segments and retransmit those that fail.
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
OSI Model – layers
description
●

●

●

6

Session Layer – controls the dialogues between
computers; establishes, manages and terminates
the connections between the local and remote
application; provides for full-duplex, half-duplex, or
simplex operation, and establishes check-pointing,
adjournment, termination, and restart procedures.
Presentation Layer – independence from
differences in data representation (e.g., encryption)
by translating from application to network format,
and vice versa; works to transform data into the form
that the application layer can accept; formats and
encrypts data to be sent across a network, providing
freedom from compatibility problems.
Application layer – interacts with software
applications that implement a communicating
component; functions include identifying
communications partners and resource availability,
and communications synchronization.
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Transport Layer (I)
●

Most common protocols for media broadcast are UDP and TCP

●

User Datagram Protocol (UDP)
—
—

Unordered - the order in which they arrive cannot be
predicted.

—

Lightweight - Small transport layer designed on top of IP.

—

7

Unreliable: no concept of acknowledgement, retransmission
and time-out

Datagrams - Packets are sent individually and are
guaranteed to be whole if they arrive.

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Transport Layer (II)
●

Transmission Control Protocol (TCP)
—

Reliable: manages message acknowledgement, retransmission
and time-out

—

Ordered - the order is well known.

—

Heavyweight - Large transport protocol designed on top of IP
●

—

8

TCP requires three packets just to set up a socket, before any
actual data can be sent....

Streaming - nothing distinguishing where one packet ends and
another begins. Packets may be split or merged into bigger or
smaller data streams arbitrarily.

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Streaming Media
Protocols
●

MMS – Microsoft Media Services
—
—

●

Deprecated in favour of RTSP
UDP or TCP

RTP/RTSP – Real Time Streaming Protocol
—

●

PNM/PNA
—

●

Real Audio/Networks proprietary

RTMP – Real Time Messaging Protocol
—

9

Open, widely used

Proprietary protocol developed by Adobe Systems
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Broadcasting raw data
●

The number of bytes produced in one second is
given by:
—

—

10FPS with 320 x 240 RGB image:

—

10

Image width x Image height x Colours (typically
RGB=3 at 8 bits) x number of frames per second
(FPS)
2304000 bytes/s ~ 2.3MB/s ~ 18432000 bits/s ~
18.4Mbits/s

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Problems with this
approach
●

●

●

Typically a user has at home a bandwidth of
something between 2 and 24 Mbits/s
If 10 users are connected the bandwidth on the
server grows to 180Mbits/s!!!
Not so good solutions
—
—

11

lower the image size
Use only one color (gray scale)

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Solution
●

Compress the image

●

Two approaches
—

Compress each image

—

Compress over time
●

●

12

This is clearly the most clever solution since most of the
time the images don't change that much!

CODECs are specialized algorithms to perform
this work

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Frame compression
●

Compress each frame:

●

Compress over time:
—

13

The difference between two the successive frames

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Video compression
●

Lossless
—
—

●

Ideal but not feasible for video broadcast. The
bandwidth is still to high
Examples are: PNG, JPEG 2000, ZIP

Lossy
—
—

14

Define the best relation between quality loss and
data reduction
Find a format which allows to maximize the
previous point

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Lossy compression
●

The big trick:
—

●

15

Remove information from video that is not important
for human perception in order to achieve very high
compression rates while still keeping very good
visual quality.

Some video formats allow ratios of 200:1 !

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Common Video Coding
Formats
●

H.261

●

H.263

●

H.264
—

●

x264

MPEG-4 AVC (Advanced Video Coding)
—

Xvid, FFmpeg, DivX, x264...

●
●

16

WMV
RealVideo
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Why x264?
●
●

Open source
H.264/MPEG-4 AVC video CODEC. Lots of
advanced encoding features

●

200:1 ratios and more...

●

Available for free in every operating system

●

Supported by most popular video players:
—

17

Quicktime, VLC, Windows Media Player 12,
mplayer

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Video sizes
●
●

QQVGA 160 × 120

quarter of a quarter of VGA

●

HQVGA 240 × 160

half of a quarter VGA

●

QVGA

320 × 240

e-lab videos (quarter of VGA)

●

VGA

640 × 480

VGA

●

18

VGA (Video Graphics Array)

XGA

1024 × 768

Extended Graphics Array

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Best bit rates
●

●

As discussed before, the output of the CODEC
must maximize the quality of the image at the
lowest bandwidth
8 kbit/s — telephone quality (using speech
codecs)

●
●

5 Mbit/s — DVD quality

●

19

120kbit/s — elab videos
15 Mbit/s — HDTV quality

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Multicast vs Unicast
●

Multicast
—
—

It is the perfect solution... but NO Internet Provider
will allow multicast on its networks

—
●

Streams the same media to all the receivers

It only works in private networks

Unicast
—
—

20

Multiple connections for the same stream
The only solution

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Streaming servers
●

Microsoft Media Services
—
—

●

Not free
In the past only support the MMS protocol (now uses RTSP)

Adobe Flash Media Streaming Server 3
—

●

Not free

Darwin Streaming Server (DSS)
—
—

Shares the same code base as QuickTime Streaming Server

—

21

Open source
Streams MPEG-4

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
e-lab structure diagram
Video Streaming Server

22

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
DSS – Reflector
●
●

●

●
●

23

Allows to deliver live broadcast to clients
Client connects to DSS which then reflects the
connection to the desired broadcast
Separate program sends RTP packets to DSS
with the video
UDP packets are sent from the source
DSS makes the bridge between the
broadcaster and the client

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Session Description
Protocol (SDP)
●

●

DSS stores files, describing each broadcaster, saved with the
SDP format
Most important information:
—
—

Media type (payload)

—

Bit rate

—

24

Port of the source

—

●

IP of the source

Title

There are programs which automatically generate these files

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
SDP Example
●

v=0

●

o=- 1204476969191332 1204476969191334 IN IP4 192.168.0.123

●

s=GAMMA

●

b=RR:0

●

t=0 0

●

a=tool:vlc 1.1.13

●

a=type:broadcast

●

m=video 2026 RTP/AVP 96

●

c=IN IP4 192.168.0.2

●

b=AS:80
(red lines can be optional)

25

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Connection flow
●

Client connects to DSS with an URL like:
—

●

●

●

26

rtsp://elabmc.ist.utl.pt/gamma.sdp

DSS parses the SDP file and connects it to the desired
source (typically an UDP port)
On the previous example the video is being sent to the
port 2026 of the 192.168.0.2 from 192.168.0.123
Client also uses the SDP file to check the media type
(in the previous case 96=MPEG4)

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Video broadcast
●

In order to send the video to the streaming
server one needs
—
—

Drivers

—

Generic API to access the images from the
cameras

—

Encoder

—

27

Cameras

Broadcaster

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Cameras
●

●

In the case of remote laboratories, commercially
available webcams are the perfect solution
Problem is that a lot of webcams only work under
Windows
—
—

28

Costs money

—
●

Imply encoding under Windows
Highly unreliable

Some webcams are supported quite well under Linux

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Video 4 Linux (V4L)
●

Video capture API for Linux;

●

Unifies the way programs access the cameras

●

Closely integrated with the Linux kernel

●

V4L is in its second version (V4L2)
—
—

29

Include a compatibility mode for V4L1
Better use V4L2 native devices/drivers

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Linux webcams
●

●
●

Look for cameras which already have a driver
in the kernel tree
Camera drivers must support native V4L2
All the cameras supported by the PWC (Phillips
USB Webcam Driver for Linux) project are a
good choice
—
—

30

Philips
Logitech Quickcams

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Video encoding
●

The ideal program grabs the video using V4L2

●

Encodes using MPEG-4

●

●

●

31

Sends the data using RTP to the streaming
server
Automatically writes an SDP file which can be
placed on the DSS
All these features are present on the VLC
project

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
VLC
●

Open-source

●

VLC live streaming
—
—

32

audio/video capture utility that can capture and
encode audio and video in real-time
results can be written to either an .mp4 file,
transmitted onto the network via either unicast or
multicast, or both simultaneously

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
VLC internals
●

Download source from
—
—

●

http://www.videolan.org/vlc/
Configure, make and install

Gentoo Linux OS:
—

emerge vlc

—

USE=”X ffmpeg libv4l2 live rtsp stream v4l2 x264”

●

Each broadcaster uses a specific configuration command

●

The program is launched with the following syntax:
—
—

33

vlc + “configurations” (with GUI)
cvlc + “configurations” (without GUI)

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
VLC configurations
●

Entire command

su elab --command "cvlc -vvv v4l2:///dev/video1 :input-slave=alsa:// :v4l2-standard=0 :file-caching=300 
--sout '#transcode{vcodec=h264,vb=80,fps=10,scale=1,width=320,height=240,acodec=none}'
':rtp{proto=udp,dst=192.168.0.2,port-video=20002,ttl=127,name=SCUBA,sdp=file:///home/elab/webcam_streaming/sdps/scuba.sdp}' 
--no-sout-audio" &

●

Parts of the command
—

Open the webcam:
●

—

Stream output (transcoding):
●

—

':rtp{proto=udp,dst=192.168.0.2,port-video=20002,ttl=127,name=SCUBA,
sdp=file:///home/elab/webcam_streaming/sdps/scuba.sdp}'

No audio:
●

34

'#transcode{vcodec=h264,vb=80,fps=10,scale=1,width=320,height=240,acodec=none}'

RTP and SDP configurations:
●

—

cvlc -vvv v4l2:///dev/video1 :input-slave=alsa:// :v4l2-standard=0 :file-caching=300

--no-sout-audio
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Launching VLC at
e-lab computer cluster
●

Each broadcaster have a script file with VLC
commands corresponding to the respective webcams
—

●

Information about the streaming port number is
located in a web-page:
—

●

/etc/local.d/vlc.start

elab1.ist.utl.pt

All broadcaster execute the script file located in their
/etc/local.d directory by executing local daemon:
—
—

35

/etc/local.d/vlc.start

which is executed by:

/etc/init.d/local start
R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
Remarks
●

●

●

This set-up allows to have a complete, opensource and free video broadcasting solution
It can be easily adapted to broadcast other kind
of sources (stored files, movies, music, etc.)
Required software
—
—

Darwin Streaming Server

—

36

Linux installation
VLC

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
The final picture

37

R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming

Más contenido relacionado

La actualidad más candente

MPEG4 codec for Access Grid
MPEG4 codec for Access GridMPEG4 codec for Access Grid
MPEG4 codec for Access GridVideoguy
 
IRATI: an open source RINA implementation for Linux/OS
IRATI: an open source RINA implementation for Linux/OSIRATI: an open source RINA implementation for Linux/OS
IRATI: an open source RINA implementation for Linux/OSICT PRISTINE
 
The H.264/AVC Advanced Video Coding Standard: Overview and ...
The H.264/AVC Advanced Video Coding Standard: Overview and ...The H.264/AVC Advanced Video Coding Standard: Overview and ...
The H.264/AVC Advanced Video Coding Standard: Overview and ...Videoguy
 
Decimator training
Decimator trainingDecimator training
Decimator trainingOmar Colom
 
Versatile Video Coding: Compression Tools for UHD and 360° Video
Versatile Video Coding: Compression Tools for UHD and 360° VideoVersatile Video Coding: Compression Tools for UHD and 360° Video
Versatile Video Coding: Compression Tools for UHD and 360° VideoMathias Wien
 
Trends and Recent Developments in Video Coding Standardization
Trends and Recent Developments in Video Coding StandardizationTrends and Recent Developments in Video Coding Standardization
Trends and Recent Developments in Video Coding StandardizationMathias Wien
 
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...Mathias Wien
 
Resume-LIN-en-2014
Resume-LIN-en-2014Resume-LIN-en-2014
Resume-LIN-en-2014lin xianjin
 
Irati goals and achievements - 3rd RINA Workshop
Irati goals and achievements - 3rd RINA WorkshopIrati goals and achievements - 3rd RINA Workshop
Irati goals and achievements - 3rd RINA WorkshopEleni Trouva
 
IBM VideoCharger and Digital Library MediaBase.doc
IBM VideoCharger and Digital Library MediaBase.docIBM VideoCharger and Digital Library MediaBase.doc
IBM VideoCharger and Digital Library MediaBase.docVideoguy
 
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)ARCFIRE ICT
 
Unreliable inter process communication in Ethernet: Migrating to RINA with th...
Unreliable inter process communication in Ethernet: Migrating to RINA with th...Unreliable inter process communication in Ethernet: Migrating to RINA with th...
Unreliable inter process communication in Ethernet: Migrating to RINA with th...Eleni Trouva
 

La actualidad más candente (14)

MPEG4 codec for Access Grid
MPEG4 codec for Access GridMPEG4 codec for Access Grid
MPEG4 codec for Access Grid
 
IRATI: an open source RINA implementation for Linux/OS
IRATI: an open source RINA implementation for Linux/OSIRATI: an open source RINA implementation for Linux/OS
IRATI: an open source RINA implementation for Linux/OS
 
Video cloud technology
Video cloud technologyVideo cloud technology
Video cloud technology
 
The H.264/AVC Advanced Video Coding Standard: Overview and ...
The H.264/AVC Advanced Video Coding Standard: Overview and ...The H.264/AVC Advanced Video Coding Standard: Overview and ...
The H.264/AVC Advanced Video Coding Standard: Overview and ...
 
Decimator training
Decimator trainingDecimator training
Decimator training
 
Versatile Video Coding: Compression Tools for UHD and 360° Video
Versatile Video Coding: Compression Tools for UHD and 360° VideoVersatile Video Coding: Compression Tools for UHD and 360° Video
Versatile Video Coding: Compression Tools for UHD and 360° Video
 
H263.ppt
H263.pptH263.ppt
H263.ppt
 
Trends and Recent Developments in Video Coding Standardization
Trends and Recent Developments in Video Coding StandardizationTrends and Recent Developments in Video Coding Standardization
Trends and Recent Developments in Video Coding Standardization
 
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...
ICME 2016 - High Efficiency Video Coding - Coding Tools and Specification: HE...
 
Resume-LIN-en-2014
Resume-LIN-en-2014Resume-LIN-en-2014
Resume-LIN-en-2014
 
Irati goals and achievements - 3rd RINA Workshop
Irati goals and achievements - 3rd RINA WorkshopIrati goals and achievements - 3rd RINA Workshop
Irati goals and achievements - 3rd RINA Workshop
 
IBM VideoCharger and Digital Library MediaBase.doc
IBM VideoCharger and Digital Library MediaBase.docIBM VideoCharger and Digital Library MediaBase.doc
IBM VideoCharger and Digital Library MediaBase.doc
 
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)
 
Unreliable inter process communication in Ethernet: Migrating to RINA with th...
Unreliable inter process communication in Ethernet: Migrating to RINA with th...Unreliable inter process communication in Ethernet: Migrating to RINA with th...
Unreliable inter process communication in Ethernet: Migrating to RINA with th...
 

Destacado

H.264 Encoder Nal Packet Formation By Sbs
H.264 Encoder Nal Packet Formation By SbsH.264 Encoder Nal Packet Formation By Sbs
H.264 Encoder Nal Packet Formation By Sbscoldfire7
 
H.264 nal and RTP
H.264 nal and RTPH.264 nal and RTP
H.264 nal and RTPYoss Cohen
 
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...Alpen-Adria-Universität
 
Boletín de Novedades literatura Junio
Boletín de Novedades literatura JunioBoletín de Novedades literatura Junio
Boletín de Novedades literatura JunioBibliotecadicoruna
 
data - driven journalism 2
data - driven journalism 2data - driven journalism 2
data - driven journalism 2FIAT/IFTA
 
MPEG-21 Digital Items in Research and Practice
MPEG-21 Digital Items in Research and PracticeMPEG-21 Digital Items in Research and Practice
MPEG-21 Digital Items in Research and PracticeAlpen-Adria-Universität
 
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI Alliance
 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineChris Adamson
 

Destacado (13)

H.264 Encoder Nal Packet Formation By Sbs
H.264 Encoder Nal Packet Formation By SbsH.264 Encoder Nal Packet Formation By Sbs
H.264 Encoder Nal Packet Formation By Sbs
 
H.264 nal and RTP
H.264 nal and RTPH.264 nal and RTP
H.264 nal and RTP
 
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...
MPEG-21-based Cross-Layer Optimization Techniques for enabling Quality of Exp...
 
Boletín de Novedades literatura Junio
Boletín de Novedades literatura JunioBoletín de Novedades literatura Junio
Boletín de Novedades literatura Junio
 
The MPEG-21 Multimedia Framework
The MPEG-21 Multimedia FrameworkThe MPEG-21 Multimedia Framework
The MPEG-21 Multimedia Framework
 
data - driven journalism 2
data - driven journalism 2data - driven journalism 2
data - driven journalism 2
 
MPEG-21 Digital Items in Research and Practice
MPEG-21 Digital Items in Research and PracticeMPEG-21 Digital Items in Research and Practice
MPEG-21 Digital Items in Research and Practice
 
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 CamerasMIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
MIPI DevCon 2016: Accelerating Software Development for MIPI CSI-2 Cameras
 
Mpeg 7
Mpeg 7Mpeg 7
Mpeg 7
 
Mpeg7
Mpeg7Mpeg7
Mpeg7
 
Gstreamer plugin development
Gstreamer plugin development Gstreamer plugin development
Gstreamer plugin development
 
GStreamer Instruments
GStreamer InstrumentsGStreamer Instruments
GStreamer Instruments
 
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is FineForward Swift 2017: Media Frameworks and Swift: This Is Fine
Forward Swift 2017: Media Frameworks and Swift: This Is Fine
 

Similar a Video streaming on e-lab

Video Streaming
Video StreamingVideo Streaming
Video StreamingVideoguy
 
PADdef presentation at IBC2014, on EBU booth
PADdef presentation at IBC2014, on EBU boothPADdef presentation at IBC2014, on EBU booth
PADdef presentation at IBC2014, on EBU boothBenoit Maujean
 
GanjiMitreaPanovskiJoveski
GanjiMitreaPanovskiJoveskiGanjiMitreaPanovskiJoveski
GanjiMitreaPanovskiJoveskiDancho Panovski
 
CommTech Talks: Challenges for Video on Demand (VoD) services
CommTech Talks: Challenges for Video on Demand (VoD) servicesCommTech Talks: Challenges for Video on Demand (VoD) services
CommTech Talks: Challenges for Video on Demand (VoD) servicesAntonio Capone
 
Design and Implementation of HDMI Transmitter
Design and Implementation of HDMI TransmitterDesign and Implementation of HDMI Transmitter
Design and Implementation of HDMI TransmitterIJERA Editor
 
IEEEGlobecom'22-OL-RICHTER.pdf
IEEEGlobecom'22-OL-RICHTER.pdfIEEEGlobecom'22-OL-RICHTER.pdf
IEEEGlobecom'22-OL-RICHTER.pdfReza Farahani
 
Paper id 2120148
Paper id 2120148Paper id 2120148
Paper id 2120148IJRAT
 
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdfAliIssa53
 
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...Raoul Monnier
 
Chapter 15 distributed mm systems
Chapter 15 distributed mm systemsChapter 15 distributed mm systems
Chapter 15 distributed mm systemsAbDul ThaYyal
 
MPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceMPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceAlpen-Adria-Universität
 
Chapter7 multimedia
Chapter7 multimediaChapter7 multimedia
Chapter7 multimediaKhánh Ghẻ
 
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video StreamingES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video StreamingAlpen-Adria-Universität
 
Emulation of Dynamic Adaptive Streaming over HTTP with Mininet
Emulation of Dynamic Adaptive Streaming over HTTP with MininetEmulation of Dynamic Adaptive Streaming over HTTP with Mininet
Emulation of Dynamic Adaptive Streaming over HTTP with MininetAnatoliy Zabrovskiy
 
An hour with WebRTC FIC UDC
An hour with WebRTC FIC UDCAn hour with WebRTC FIC UDC
An hour with WebRTC FIC UDCQuobis
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER) ijceronline
 

Similar a Video streaming on e-lab (20)

Multimedia Services: Video
Multimedia Services: VideoMultimedia Services: Video
Multimedia Services: Video
 
Multi Streaming Player
Multi Streaming PlayerMulti Streaming Player
Multi Streaming Player
 
Prashant Resume
Prashant ResumePrashant Resume
Prashant Resume
 
3DgraphicsAndAR
3DgraphicsAndAR3DgraphicsAndAR
3DgraphicsAndAR
 
Video Streaming
Video StreamingVideo Streaming
Video Streaming
 
PADdef presentation at IBC2014, on EBU booth
PADdef presentation at IBC2014, on EBU boothPADdef presentation at IBC2014, on EBU booth
PADdef presentation at IBC2014, on EBU booth
 
GanjiMitreaPanovskiJoveski
GanjiMitreaPanovskiJoveskiGanjiMitreaPanovskiJoveski
GanjiMitreaPanovskiJoveski
 
CommTech Talks: Challenges for Video on Demand (VoD) services
CommTech Talks: Challenges for Video on Demand (VoD) servicesCommTech Talks: Challenges for Video on Demand (VoD) services
CommTech Talks: Challenges for Video on Demand (VoD) services
 
Design and Implementation of HDMI Transmitter
Design and Implementation of HDMI TransmitterDesign and Implementation of HDMI Transmitter
Design and Implementation of HDMI Transmitter
 
IEEEGlobecom'22-OL-RICHTER.pdf
IEEEGlobecom'22-OL-RICHTER.pdfIEEEGlobecom'22-OL-RICHTER.pdf
IEEEGlobecom'22-OL-RICHTER.pdf
 
Paper id 2120148
Paper id 2120148Paper id 2120148
Paper id 2120148
 
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
1_MWS2018_Tutorial1_Pham_Internet Delivered Media.pdf
 
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...
H2B2VS (HEVC hybrid broadcast broadband video services) – Building innovative...
 
Chapter 15 distributed mm systems
Chapter 15 distributed mm systemsChapter 15 distributed mm systems
Chapter 15 distributed mm systems
 
MPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and ConformanceMPEG-DASH Reference Software and Conformance
MPEG-DASH Reference Software and Conformance
 
Chapter7 multimedia
Chapter7 multimediaChapter7 multimedia
Chapter7 multimedia
 
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video StreamingES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming
ES-HAS: An Edge- and SDN-Assisted Framework for HTTP Adaptive Video Streaming
 
Emulation of Dynamic Adaptive Streaming over HTTP with Mininet
Emulation of Dynamic Adaptive Streaming over HTTP with MininetEmulation of Dynamic Adaptive Streaming over HTTP with Mininet
Emulation of Dynamic Adaptive Streaming over HTTP with Mininet
 
An hour with WebRTC FIC UDC
An hour with WebRTC FIC UDCAn hour with WebRTC FIC UDC
An hour with WebRTC FIC UDC
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 

Último

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Último (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Video streaming on e-lab

  • 1. Video Streaming Rafael Bagagem Henriques rhenriques@ipfn.ist.utl.pt e-lab Instituto Superior Técnico Lisboa, Portugal http://elab.ist.utl.pt R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 2. Streaming multimedia ● ● ● Multimedia that is constantly received by, and normally displayed to, the end-user A media stream can be on demand or live Usually applied to media that are distributed over telecommunications networks — ● Real world examples — 2 Radio and TV are inherently streaming Youtube, on-line TV and Radios, etc. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 3. OSI Model ● 3 A set of seven layers that define the different stages that data must go through to travel from one device to another over a network R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 4. OSI Model – layers and instances ● ● 4 Layer – a collection of conceptually similar functions that provide services to the layer above and receives service from the layer below. Instance – on each layer an instance provides services to the instances at the layer above and requests service from the layer below; conceptually two instances at one layer are connected by a horizontal protocol connection on that layer. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 5. OSI Model – layers description ● ● ● ● 5 Physical Layer – electrical and physical specifications (layout of pins, voltages, cable specifications, hubs, network adapters … Data Link Layer – functional and procedural means to transfer data; detect/correct errors on Physical. Network Layer – functional and procedural means of transferring variable length data via one or more networks; performs network routing functions; perform fragmentation/reassembly, and report delivery errors; maintain the QoS requested by the Transport. Transport Layer – provides transparent transfer of data between end users, providing reliable data transfer services to upper layers; controls reliability of a given link through flow control, segmentation and de-segmentation, and error control; keep track of the segments and retransmit those that fail. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 6. OSI Model – layers description ● ● ● 6 Session Layer – controls the dialogues between computers; establishes, manages and terminates the connections between the local and remote application; provides for full-duplex, half-duplex, or simplex operation, and establishes check-pointing, adjournment, termination, and restart procedures. Presentation Layer – independence from differences in data representation (e.g., encryption) by translating from application to network format, and vice versa; works to transform data into the form that the application layer can accept; formats and encrypts data to be sent across a network, providing freedom from compatibility problems. Application layer – interacts with software applications that implement a communicating component; functions include identifying communications partners and resource availability, and communications synchronization. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 7. Transport Layer (I) ● Most common protocols for media broadcast are UDP and TCP ● User Datagram Protocol (UDP) — — Unordered - the order in which they arrive cannot be predicted. — Lightweight - Small transport layer designed on top of IP. — 7 Unreliable: no concept of acknowledgement, retransmission and time-out Datagrams - Packets are sent individually and are guaranteed to be whole if they arrive. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 8. Transport Layer (II) ● Transmission Control Protocol (TCP) — Reliable: manages message acknowledgement, retransmission and time-out — Ordered - the order is well known. — Heavyweight - Large transport protocol designed on top of IP ● — 8 TCP requires three packets just to set up a socket, before any actual data can be sent.... Streaming - nothing distinguishing where one packet ends and another begins. Packets may be split or merged into bigger or smaller data streams arbitrarily. R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 9. Streaming Media Protocols ● MMS – Microsoft Media Services — — ● Deprecated in favour of RTSP UDP or TCP RTP/RTSP – Real Time Streaming Protocol — ● PNM/PNA — ● Real Audio/Networks proprietary RTMP – Real Time Messaging Protocol — 9 Open, widely used Proprietary protocol developed by Adobe Systems R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 10. Broadcasting raw data ● The number of bytes produced in one second is given by: — — 10FPS with 320 x 240 RGB image: — 10 Image width x Image height x Colours (typically RGB=3 at 8 bits) x number of frames per second (FPS) 2304000 bytes/s ~ 2.3MB/s ~ 18432000 bits/s ~ 18.4Mbits/s R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 11. Problems with this approach ● ● ● Typically a user has at home a bandwidth of something between 2 and 24 Mbits/s If 10 users are connected the bandwidth on the server grows to 180Mbits/s!!! Not so good solutions — — 11 lower the image size Use only one color (gray scale) R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 12. Solution ● Compress the image ● Two approaches — Compress each image — Compress over time ● ● 12 This is clearly the most clever solution since most of the time the images don't change that much! CODECs are specialized algorithms to perform this work R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 13. Frame compression ● Compress each frame: ● Compress over time: — 13 The difference between two the successive frames R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 14. Video compression ● Lossless — — ● Ideal but not feasible for video broadcast. The bandwidth is still to high Examples are: PNG, JPEG 2000, ZIP Lossy — — 14 Define the best relation between quality loss and data reduction Find a format which allows to maximize the previous point R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 15. Lossy compression ● The big trick: — ● 15 Remove information from video that is not important for human perception in order to achieve very high compression rates while still keeping very good visual quality. Some video formats allow ratios of 200:1 ! R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 16. Common Video Coding Formats ● H.261 ● H.263 ● H.264 — ● x264 MPEG-4 AVC (Advanced Video Coding) — Xvid, FFmpeg, DivX, x264... ● ● 16 WMV RealVideo R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 17. Why x264? ● ● Open source H.264/MPEG-4 AVC video CODEC. Lots of advanced encoding features ● 200:1 ratios and more... ● Available for free in every operating system ● Supported by most popular video players: — 17 Quicktime, VLC, Windows Media Player 12, mplayer R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 18. Video sizes ● ● QQVGA 160 × 120 quarter of a quarter of VGA ● HQVGA 240 × 160 half of a quarter VGA ● QVGA 320 × 240 e-lab videos (quarter of VGA) ● VGA 640 × 480 VGA ● 18 VGA (Video Graphics Array) XGA 1024 × 768 Extended Graphics Array R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 19. Best bit rates ● ● As discussed before, the output of the CODEC must maximize the quality of the image at the lowest bandwidth 8 kbit/s — telephone quality (using speech codecs) ● ● 5 Mbit/s — DVD quality ● 19 120kbit/s — elab videos 15 Mbit/s — HDTV quality R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 20. Multicast vs Unicast ● Multicast — — It is the perfect solution... but NO Internet Provider will allow multicast on its networks — ● Streams the same media to all the receivers It only works in private networks Unicast — — 20 Multiple connections for the same stream The only solution R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 21. Streaming servers ● Microsoft Media Services — — ● Not free In the past only support the MMS protocol (now uses RTSP) Adobe Flash Media Streaming Server 3 — ● Not free Darwin Streaming Server (DSS) — — Shares the same code base as QuickTime Streaming Server — 21 Open source Streams MPEG-4 R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 22. e-lab structure diagram Video Streaming Server 22 R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 23. DSS – Reflector ● ● ● ● ● 23 Allows to deliver live broadcast to clients Client connects to DSS which then reflects the connection to the desired broadcast Separate program sends RTP packets to DSS with the video UDP packets are sent from the source DSS makes the bridge between the broadcaster and the client R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 24. Session Description Protocol (SDP) ● ● DSS stores files, describing each broadcaster, saved with the SDP format Most important information: — — Media type (payload) — Bit rate — 24 Port of the source — ● IP of the source Title There are programs which automatically generate these files R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 25. SDP Example ● v=0 ● o=- 1204476969191332 1204476969191334 IN IP4 192.168.0.123 ● s=GAMMA ● b=RR:0 ● t=0 0 ● a=tool:vlc 1.1.13 ● a=type:broadcast ● m=video 2026 RTP/AVP 96 ● c=IN IP4 192.168.0.2 ● b=AS:80 (red lines can be optional) 25 R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 26. Connection flow ● Client connects to DSS with an URL like: — ● ● ● 26 rtsp://elabmc.ist.utl.pt/gamma.sdp DSS parses the SDP file and connects it to the desired source (typically an UDP port) On the previous example the video is being sent to the port 2026 of the 192.168.0.2 from 192.168.0.123 Client also uses the SDP file to check the media type (in the previous case 96=MPEG4) R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 27. Video broadcast ● In order to send the video to the streaming server one needs — — Drivers — Generic API to access the images from the cameras — Encoder — 27 Cameras Broadcaster R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 28. Cameras ● ● In the case of remote laboratories, commercially available webcams are the perfect solution Problem is that a lot of webcams only work under Windows — — 28 Costs money — ● Imply encoding under Windows Highly unreliable Some webcams are supported quite well under Linux R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 29. Video 4 Linux (V4L) ● Video capture API for Linux; ● Unifies the way programs access the cameras ● Closely integrated with the Linux kernel ● V4L is in its second version (V4L2) — — 29 Include a compatibility mode for V4L1 Better use V4L2 native devices/drivers R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 30. Linux webcams ● ● ● Look for cameras which already have a driver in the kernel tree Camera drivers must support native V4L2 All the cameras supported by the PWC (Phillips USB Webcam Driver for Linux) project are a good choice — — 30 Philips Logitech Quickcams R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 31. Video encoding ● The ideal program grabs the video using V4L2 ● Encodes using MPEG-4 ● ● ● 31 Sends the data using RTP to the streaming server Automatically writes an SDP file which can be placed on the DSS All these features are present on the VLC project R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 32. VLC ● Open-source ● VLC live streaming — — 32 audio/video capture utility that can capture and encode audio and video in real-time results can be written to either an .mp4 file, transmitted onto the network via either unicast or multicast, or both simultaneously R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 33. VLC internals ● Download source from — — ● http://www.videolan.org/vlc/ Configure, make and install Gentoo Linux OS: — emerge vlc — USE=”X ffmpeg libv4l2 live rtsp stream v4l2 x264” ● Each broadcaster uses a specific configuration command ● The program is launched with the following syntax: — — 33 vlc + “configurations” (with GUI) cvlc + “configurations” (without GUI) R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 34. VLC configurations ● Entire command su elab --command "cvlc -vvv v4l2:///dev/video1 :input-slave=alsa:// :v4l2-standard=0 :file-caching=300 --sout '#transcode{vcodec=h264,vb=80,fps=10,scale=1,width=320,height=240,acodec=none}' ':rtp{proto=udp,dst=192.168.0.2,port-video=20002,ttl=127,name=SCUBA,sdp=file:///home/elab/webcam_streaming/sdps/scuba.sdp}' --no-sout-audio" & ● Parts of the command — Open the webcam: ● — Stream output (transcoding): ● — ':rtp{proto=udp,dst=192.168.0.2,port-video=20002,ttl=127,name=SCUBA, sdp=file:///home/elab/webcam_streaming/sdps/scuba.sdp}' No audio: ● 34 '#transcode{vcodec=h264,vb=80,fps=10,scale=1,width=320,height=240,acodec=none}' RTP and SDP configurations: ● — cvlc -vvv v4l2:///dev/video1 :input-slave=alsa:// :v4l2-standard=0 :file-caching=300 --no-sout-audio R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 35. Launching VLC at e-lab computer cluster ● Each broadcaster have a script file with VLC commands corresponding to the respective webcams — ● Information about the streaming port number is located in a web-page: — ● /etc/local.d/vlc.start elab1.ist.utl.pt All broadcaster execute the script file located in their /etc/local.d directory by executing local daemon: — — 35 /etc/local.d/vlc.start which is executed by: /etc/init.d/local start R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 36. Remarks ● ● ● This set-up allows to have a complete, opensource and free video broadcasting solution It can be easily adapted to broadcast other kind of sources (stored files, movies, music, etc.) Required software — — Darwin Streaming Server — 36 Linux installation VLC R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming
  • 37. The final picture 37 R. B. Henriques | Lisbon, 23 March 2012 | Video Streaming