Custom Search

Monday, January 17, 2011

Audio & Video Streaming using HTTP

Progressive Streaming of Audio and Video using HTTP

Current Literature
System Model
A playback consists of a disk-read which feeds samples into a (D/A) converter at the same rate at which they were sampled and a display which consumes data the rate at which it has recorded.
The D/A converter creates a signal that closely approximates the original to the display (or playout) unit.
Sometimes the samples are not delivered to the D/A converter at precisely the rate at which the sampling occurred, the reproduced sound (or video) does not match the sampled sound (or video).
The data is not compressed.
Digitization of video is done by using analog frames of video data at fixed intervals and storing them in binary form.
Digitization of audio data is most commonly achieved by sampling an analog signal at fixed intervals and by storing the amplitude of each sample in binary form.
Reading the digitized multimedia data (either video or audio or text or images, etc.) is used to refer to retrieving data from the storage device(s), while the term “consume” is used refer to data being consumed by the D/A converter for playout.

Cons of the System
Mainly delays exist in storage devices and playback units.
The delays may crop up due to mainly seeking the information on the disk or reading the data on the old disk systems which need to be read several times for fetching the correct data
Rate of data receiving may be much higher than the rate of consumption
Delays may be created in the disk system for optimal utilization of the resources

Aim :
Implementing low cost Progressive Streaming of Video & Audio over HTTP protocol. Main aim of this solution is to capture, send and play the video of conference through HTTP.
Progressive streaming is a varient of real-time streaming. Real-time streaming of media allows users to play media as they receive it. also called HTTP streaming because it uses the commonly used HTTP protocol and standard HTTP servers to deliver media files. Users don't have to wait for the whole media file to be downloaded before watching.

Overview
To enable real-time streaming, dedicated streaming media servers and streaming protocols, such as Real Time Protocol (RTP), are required. RTP is an Internet standard for transporting real-time data. It uses the unreliable UDP protocol to transmit packets.
Progressive streaming enables files to be watched as they are downloaded. When the client makes a request (HTTP) to the server for the media file, the file eventually gets stored in the client's memory buffer. The playback is allowed before the entire file gets downloaded.
This Project uses JAVA Socket programming API’s to send the RTSP commands over TCP and send/receive RTP packets over UDP.

Project Breakup
The project can be divided into following 4 phases –
Client – This class implements the client and the user interface which will be used to send RTSP commands and is used to display the video.
Server – This class implements the server which responds to the RTSP requests and streams back the video.
RTP Packet – The class is used to handle the RTP packets. Both Client and Server use this.
Video Stream – This class is used to read video data from the file on disk

Implementation
The Code

In this project we will implement a streaming video server and client that communicate using the Real-Time Streaming Protocol (RTSP) and send data using the Real-time Transfer Protocol (RTP).Our task is to implement the RTSP protocol in the client and implement the RTP packetization in the server. The code implements the RTSP protocol in the server, the RTP de-packetization in the client, and takes care of displaying the transmitted video.

There will be 4 classes in our implementation.

Client
This class implements the client and the user interface which we use to send RTSP commands and which is used to display the video. This class implements the actions that are taken when the buttons are pressed.

Server
This class implements the server which responds to the RTSP requests and streams back the video. The RTSP interaction is already implemented and the server calls routines in the RTPpacket class to packetize the video data.

RTP packet
This class is used to handle the RTP packets. It has separate routines for handling the received packets at the client side. The first constructor of this class to implement RTP-packetization of the video data. The second constructor is used by the client to de-packetize the data.

Video/Audio Stream
This class is used to read video/audio data from the file on disk.

Working
The client opens a connection to the server and popup a window.
User can send RTSP commands to the server by pressing the buttons. A normal RTSP interaction goes as follows.

Client sends SETUP. This command is used to set up the session and transport parameters.
Client sends PLAY. This starts the playback.
Client may send PAUSE if it wants to pause during playback.
Client sends TEARDOWN. This terminates the session and closes the connection.

The server always replies to all the messages the client sends. The reply codes are roughly the same as in HTTP. The code 200 means that the request was successful.

System Specification
Software Requirements
Operating system – 2000,XP or higher
Java
Eclipse
Hardware Requirements
512 MB RAM
P4 processor

Advantages
Reduce setup time
Reduction in client storage requirement
Video can be viewed in real time
Transmission signals over low bandwidth facilities
Real time audio content.
Low bandwidth media used.
No waiting for downloading audio file.
Internet users can enjoy a live online program.

0 comments:

Post a Comment