14
MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Embed Size (px)

Citation preview

Page 1: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

MP 2: Audio/ Video Streaming

CS414: Multimedia SystemInstructor: Klara Nahrstedt

March 21, 2014

Page 2: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Covered Aspects of Multimedia

Image/VideoCapture

MediaServerStorage

Transmission

CompressionProcessing

Audio/VideoPresentationPlaybackAudio/Video

Perception/ Playback

Audio InformationRepresentation

Transmission

AudioCapture

A/V Playback

Image/Video InformationRepresentation

Page 3: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Learning Goals• Learning media streaming using network

• Learning audio video synchronization mechanism

• Understanding following multimedia system concepts– Resource Admission– QoS Negotiation– QoS Enforcement– Session Control– Session Adaptation

• Understanding network dynamics such as end-to-end delay, network jitter, and synchronization skew

server client

Page 4: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

System Components

Server Client

• Server– Stored Audio and Video– Video: 30 fps, Audio: 8000Hz

• Client– Requests for Video and/or Audio– Works in Two modes: Active Mode and Passive Mode

Control Channel

Data Channel

• Active Mode: Media type: Audio, VideoVideo Rate: 15 to 25 fpsAudio Rate: 8000Hz

• Passive Mode: Media type: VideoVideo Rate: 10 fps

Page 5: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Functional Diagram: Connection Establishment

Client Server

Stream Request: <media file, media type, rates>

Stream Request Accept/ Reject

Resource admissio

n

RTP/ UDP

QoS Enforceme

nt

Take user-inputs(mode)

Server listening

Resource

admission

AV Synchronization

resource.txt

resource.txt

Session Monitor

Client listening

Resource Reservatio

nResource Reservation

Page 6: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Functional Diagram: Control Playback

Client Server

Control Command: PAUSE

RTP/ UDP

QoS Enforceme

nt

User requests PAUSE

Server listening

AV Synchronizatio

nSession Monitor

Client is streaming from the Server

Stop streaming[does not close connection states]User requests

RESUME Control Command: RESUME

Resume streaming from current position

Control Command: STOP Clear Resource

ReservationThen new connection will require the connection setup phase

User requests STOP

Page 7: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Functional Diagram: Session Adaptation

Client Server

User Change Bandwidth

Server always

listening resource.txt

Resource admissio

n Stream Request: < media file, media type, rates>

Stream Request Accept/ Reject

RTP/ UDP

QoS Enforceme

nt

Resource

admission

resource.txt

Client listening

Resource Reservatio

nResource

Reservation

AV Synchronizatio

nSession Monitor

Page 8: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Resource Admission• Client

– Available Application Bandwidth ABN

– Application Frame Size, MN = ?

– Application Frame Rate, RN = ?– Audio Bandwidth = 8000 * 16– Bandwidth

• Active Mode: BN = (MN * RN) + Audio Bandwidth

• Passive Mode: BN = (MN * RN)

resource.txt

Optimistic Allocation

8000Hz Audio Signal

In active mode, the video rate should be considered the Maximum between [15fps-25fps] provided that ABN>= BN

Notice: You have to be able to show your computation during the demo

fps: 10

MJPEG Video

Assuming resolution is

known by the client, e.g., stated in the file name like

“MIB3-1080p.mjpeg

Page 9: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Resource Admission

• Server– Available Application Bandwidth ABN

– Required Bandwidth for Client BC

– Admission is successful if BC <= ABN

– To support multiple client• You also need to consider bandwidth assigned to other

resource.txt

Client1 10

Client2 10

Resource Table

Page 10: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Rate Control: QoS Enforcement

• You can build leaky bucket• You can implement token bucket• You can use gstreamer rate control• You can implement your own method

Sleep (100) => 10 fps

You an simply read using loop

You have to do this for both audio and video

Page 11: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Synchronization

• Build your own synchronization algorithm

• Synchronization Skew < 80 ms

• Display synchronization skew on the screen

Payload

Media Type Timestamp RTP header

Page 12: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Server-side Data Flow Architecture

Videosource

App Sink

Audiosource

App Sink

Vide

o Q

ueue

Audi

o Q

ueue

Rate Control

Rate Control

App Sink

App Sink

Capture timestamp

Capture timestamp

RTP header

RTP header

Network

You can use gstreamer Pipeline

Page 13: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Client Side Data Flow Architecture

Vide

o Q

ueue

Audi

o Q

ueue

Synchronization

RTP header

RTP header

Network

App Source

AudioSink

App Source

VideoSink

AudioDecoder

VideoDecoder

http://code.google.com/p/gstreamer-java/source/browse/trunk/gstreamer-java/src/org/gstreamer/example/AppSrcTest.java?r=509

How to use AppSrc?

Page 14: MP 2: Audio/ Video Streaming CS414: Multimedia System Instructor: Klara Nahrstedt March 21, 2014

Evaluations

Features Points Properties

Video Streaming 10 Use MJPEG encoding. It will make rate adaptation easier.

Audio Streaming 10 you can use any audio encoding

A/V Synchronization 15 synchronization skew <= 80ms

Resource Admission 10

Rate Control 15

Session Control 10 STOP, START, PAUSE, RESUME, SWITCH, REW, FF

Session Adaptation 10 should allow to change “resource.txt” (via GUI)

Session Monitoring 10 synchronization skew, jitter, e2e delay, failure rate

Report Writing 10 clearly write your algorithms and development manual

Support Multi-Client 30 make sure you properly use server resources

Required Points: 100, Optional Points: 30

Points will be considered based on live demo and interview performance