h.263 video codec

32
•Click to edit Master text styles –Second level •Third level –Fourth level »Fifth level VIDEO TRANSMISSION OVER ETHERNET USING H.263 CODEC Presented by: Kavisha BTBTI09124 B.Tech(I.T.)-VII sem Video Transmission Over Ethernet Using H.263 Codec | 2013

Upload: kavisha-miyan

Post on 17-May-2015

1.172 views

Category:

Technology


3 download

DESCRIPTION

Video Transmission over Ethernet using H.263 Codec

TRANSCRIPT

Page 1: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO TRANSMISSION OVER ETHERNET USING H.263 CODEC

Presented by: Kavisha

BTBTI09124 B.Tech(I.T.)-VII sem

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 2: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

AIM OF THE PROJECT

The project aims at capturing a real time video frame sequence by a web camera and compressing the captured frames with H.263 codec and transmitting the encoded bit stream over Ethernet, subsequently decoding it at the receiving end for display, by the implementation of codec & analyzing its performance & its image quality.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 3: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

TOOLS USED

Platform : Linux (Red Hat Enterprise Linux 6)Language : CTools Used : EclipseHardware : PC, Webcam

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 4: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

WHAT IS A VIDEO?

Video consists of a time ordered sequence of correlated images called frames.

Live streaming of video refers to the sequence of frames constantly received by and presented to the end user while being delivered by the stream provider.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 5: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

WHY WE NEED COMPRESSION?

One movie video without compression having:• 640 x 480 pixels per frame• 30 frames per second• Total 90 minutes• Full color

The total quantity of data = 167.96 GB !!

How to stream this large amount of data over network?The purpose of video compression is to cram more

information into less space and bandwidth.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 6: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO COMPRESSIONVideo Transmission Over Ethernet Using H.263 Codec | 2013

1. Compress and in one frame.

2. Compress the motion of in remaining frames.

Page 7: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO COMPRESSION

• CODEC stands for enCOder/DECoder.

--convert video stream into a format that takes up less space when its stored or transmitted & then decode that format into video stream again.

• A device or a program that compresses a video signal is called an encoder and a device or a program that decompresses the video signal is called a decoder.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 8: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

H.263

• H.263 is a real time compression & decompression algorithm for video communication at low bitrates.

• It gives enhanced visual quality at very low bitrates say around 28 kbps.

• It is used for Video on Demand and streaming services.

• It is based on using the Discrete Cosine Transform (DCT) and Motion Estimation and Compensation to remove temporal redundancies.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 9: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO ENCODINGVideo Transmission Over Ethernet Using H.263 Codec | 2013

Demonstration Flow Diagram

Page 10: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO CAPTURE

• Video stream is captured by means of a webcam with the help of SDL (Simple DirectMedia Layer).

• Simple DirectMedia Layer (SDL) is a free cross-platform multi-media development API.

• The code for video capture is written using SDL libraries and Video For Linux 2 (V4L2) specifications.

• The standard file for accessing webcam on linux is “/dev/video0”.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 11: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO CAPTURE

• The web cam captures video in YUV format but for rendering it on screen its converted to RGB format.

• In the application it is converted to RGB(BITMAP) format using the formulae: r = y + (1.370705 * (v-128));g = y - (0.698001 * (v-128)) - (0.337633 * (u-128));b = y + (1.732446 * (u-128));

where, y : represents Luminance.

u (Cb) : is the Chroma channel, blue component. v (Cr) : is the Chroma channel, red component.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 12: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO CAPTUREVideo Transmission Over Ethernet Using H.263 Codec | 2013

Page 13: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO FRAME FORMATS

All versions of H.263 support five standardized picture formats:

• The choice of frame resolution depends on application and available storage or transmission capacity.

• CIF and QCIF are popular for the videoconferencing applications.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 14: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO ENCODING

• Video coding aims at providing a compact representation of the information in the video frames by removing spatial redundancies that exist within the frames, and also temporal redundancies that exist between successive frames.

• Each picture is divided into Macroblocks (16x16) where each macroblock consists of 4 luminance blocks and 2 spatially aligned color difference blocks. Each block consists of 8 pixels x 8 lines of luminance or chrominance.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 15: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO FORMAT

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 16: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO ENCODING

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 17: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO ENCODING

16 16 Macroblocks

Frame n

Frame n-1

Motion vector Search range

Residual

Y

Cb

Cr

DCT, Quantization, Zigzag, Entropy coding

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 18: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

ENCODING PARAMETERS

• Input sequence is YUV format video with frame rate of 25fps. This is the video we get directly for webcam.

• Bitmap format is used for rendering the image on screen.

• In encoder, profile is with 8x8 transform and VLC (Variable Length Coding) Entropy coding method is used.

• Frame rate is initialized with 25fps.• Initialization Quantization Parameter is taken as

10.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 19: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

PACKETIZATION

• Datagram Sockets are created at both ends for sending & receiving encoded video bitstream.

• The encoded bitstream is made into packets of size 1300 bytes to be transmitted over network.

• Structure packet_struct defines the packet header.

#define DATA_SIZE1300typedef struct packet_struct{

int seq_no; int packets; int data_len;

}packet_struct;

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 20: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

PACKETIZATION

• The packets are formed after attaching the packet header to data.

• The packets are pushed into the queue to be transmitted over the network.

PACKET QUEUE

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 21: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

PACKETIZATION

/* to count the number of packets */if(data_length % data_size) total_packets = data_length/data_size+1;else total_packets = data_length/data_size;

Video Transmission Over Ethernet Using H.263 Codec | 2013

• At the receiver side the incoming packets are pushed in the queue until the complete buffer is received.

Page 22: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

PACKETIZATION

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 23: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

PACKETIZATION

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 24: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO DECODINGVideo Transmission Over Ethernet Using H.263 Codec | 2013

Page 25: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

VIDEO DECODINGVideo Transmission Over Ethernet Using H.263 Codec | 2013

Page 26: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

OUTPUT

Captured Image Decompressed Image

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 27: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

COMPRESSION RATIO

• The size of a single YUV frame (176x144) is about 50KB.• The captured YUV frame is converted to RGB (176x144)

Bitmap image rendered for display.• The size of a single RGB frame is about 75 KB.• The size of compressed bitstream for a single frame is

~9.6 KB.

CR = Compressed Size / Uncompressed SizeCR= 9.6 / 49.5 = 0.19 ~ 0.2

• The image is thus compressed nearly by 5 times with respect to the original one.

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 28: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

Quality Measurement & PSNR

• PSNR (Peak Signal to Noise Ratio) calculation of two images, one original and an altered image, describes how far two images are equal.

• A higher PSNR would normally indicate that the reconstruction is of higher quality.

Video Transmission Over Ethernet Using H.263 Codec | 2013

. PSNR formula

MSE: Mean-Square error.x: width of image.y: height.

Page 29: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

Quality Measurement & PSNR

The Peak Signal to Noise Ratio (PSNR) for a QCIF Frame (176x144) is calculated at different frame rates say 25 fps, 30fps.

Component PSNR(dB)

PSNR_Y 30.74

PSNR_Cb 29.95

PSNR_Cr 30.58PSNR at 30 fps

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 30: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

Quality Measurement & PSNR

Component PSNR(dB)

PSNR_Y 31.16

PSNR_Cb 30.47

PSNR_Cr 29.79

PSNR at 25 fps

Video Transmission Over Ethernet Using H.263 Codec | 2013

Page 31: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

ReferencesVideo Transmission Over Ethernet Using H.263 Codec | 2013

[1] ITU-T Draft H.263, “Video Coding for Low Bit Rate Communication”, May 1996.

[2] Michael H. Schimek, “V4L2 (Video for Linux 2) Specifications: Revision 0.24”, 2008.

[3] Sam Lantinga, “Simple DirectMedia Layer (SDL): Revision 1.2”, Loki Entertainment Software, 2007.

[4] ITU Telecom.“ Video Codec Test Model Near- term, Version 8 (TMN-8), H.263 Ad Hoc Group, June 1997.Eric Weitzel, “Basic Video Compression Techniques”, Ouroborros Publications, March 2004.

Page 32: H.263 Video Codec

•Click to edit Master text styles–Second level

•Third level–Fourth level

»Fifth level

ReferencesVideo Transmission Over Ethernet Using H.263 Codec | 2013

[5] Ismail Erturk, Yildiray Yalmal, “A new color image quality measure based on YUV transformation and PSNR for human vision system”, Department of Computer Engineering, Turgut Ozal University, Turkey, 2011.

[6] Karel Rijkse, “H.263: Video Coding for Low-Bit-Rate Communication”, KPN Research, IEEE Communications Magazine, pp.42-45, December 1996.