This document discusses a project that aims to capture real-time video frames using a webcam, compress the frames using the H.263 codec, transmit the encoded stream over Ethernet, decode it at the receiving end for display. It describes the tools, video compression and encoding process using H.263, packetization for transmission, decoding, and analysis of compression ratio and quality using PSNR.
IAC 2024 - IA Fast Track to Search Focused AI Solutions
H.263 Video Codec
1. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO TRANSMISSION OVER ETHERNET USING
•Click to edit Master text styles
–Second level H.263 CODEC
•Third level
–Fourth level
»Fifth level
Presented by:
Kavisha
BTBTI09124
B.Tech(I.T.)-VII sem
2. Video Transmission Over Ethernet Using H.263 Codec |
2013
AIM OF THE PROJECT
The project aims at capturing a real time video frame
•Click to edit web camera and compressing the
sequence by a Master text styles
–Second level
captured frames with H.263 codec and transmitting
•Third bit
the encodedlevel stream over Ethernet, subsequently
decoding –Fourththe receiving end for display, by the
it at level
»Fifth level
implementation of codec & analyzing its performance
& its image quality.
3. Video Transmission Over Ethernet Using H.263 Codec |
2013
TOOLS USED
Platform : Linux (Red Hat Enterprise Linux 6)
•Click to edit Master text styles
Language : C
–Second level
Tools Used :level Eclipse
•Third
Hardware–Fourth level Webcam
: PC,
»Fifth level
4. Video Transmission Over Ethernet Using H.263 Codec |
2013
WHAT IS A VIDEO?
Video consists of a time ordered sequence of
•Click to edit Master text styles
correlated images called frames.
–Second level
•Third level
Live streaming of video refers to the sequence of
–Fourth level
frames constantlylevel
»Fifth
received by and presented to the
end user while being delivered by the stream provider.
5. Video Transmission Over Ethernet Using H.263 Codec |
2013
WHY WE NEED COMPRESSION?
One movie video without compression having:
••Clickxto edit Master text styles
640 480 pixels per frame
–Second level
• 30 frames per second
•Third level
• Total 90 minutes
–Fourth level
• Full color »Fifth level
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.
6. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO COMPRESSION
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
1. Compress and in one frame.
2. Compress the motion of in remaining frames.
7. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO COMPRESSION
• CODEC stands for enCOder/DECoder.
•Click to edit Master text styles
--convert video stream into a format that takes up less
–Second level
space when its stored or transmitted & then decode
•Third level
that format into video stream again.
–Fourth level
»Fifth level
• 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.
8. Video Transmission Over Ethernet Using H.263 Codec |
2013
H.263
• H.263 is a real time compression & decompression
algorithm for video communication at low bitrates.
•Click to edit Master text styles
–Second level
• It gives enhanced visual quality at very low bitrates
•Third level
say around 28 kbps.
–Fourth level
»Fifth level
• 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.
9. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO ENCODING
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
Demonstration Flow Diagram
10. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO CAPTURE
• Video stream is captured by means of a webcam with
•Click to of SDLMaster DirectMedia Layer).
the help edit (Simple text styles
–Second level
• Simple DirectMedia Layer (SDL) is a free cross-
•Third level
platform multi-media development API.
–Fourth level
»Fifth level
• 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”.
11. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO CAPTURE
• The web cam captures video in YUV format but for
rendering it on screen its converted to RGB format.
• •Click to edit Master text styles
In the application it is converted to RGB(BITMAP)
–Second level
format using the formulae:
•Third level
r = y + (1.370705 * (v-128));
–Fourth level
g = y - (0.698001 * (v-128)) - (0.337633 * (u-128));
»Fifth level
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.
12. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO CAPTURE
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
13. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO FRAME FORMATS
All versions of H.263 support five standardized picture
formats:
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
• The choice of frame resolution depends on
application and available storage or transmission
capacity.
• CIF and QCIF are popular for the videoconferencing
applications.
14. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO ENCODING
• Video coding aims at providing a compact
•Click to edit Masterinformation in the video frames
representation of the text styles
by removing spatial redundancies that exist within
–Second level
the frames, and also temporal redundancies that exist
•Third level
between successive frames.
–Fourth level
»Fifth level
• 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.
15. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO FORMAT
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
16. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO ENCODING
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
17. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO ENCODING
16 × 16 Macroblocks
•Click to Frame n Master text styles
edit
–Second level
•Third level
Frame n-1 Y
–Fourth level DCT, Quantization,
»Fifth level Residual Zigzag, Entropy coding
Cb
Cr
Motion vector Search range
18. Video Transmission Over Ethernet Using H.263 Codec |
2013
ENCODING PARAMETERS
• Input sequence is YUV format video with frame rate
•Click25fps. This is the video we get directly for
of to edit Master text styles
webcam.
–Second level
• Bitmap format is used for rendering the image on
•Third level
screen.–Fourth level
»Fifth level
• 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.
19. Video Transmission Over Ethernet Using H.263 Codec |
2013
PACKETIZATION
• Datagram Sockets are created at both ends for
sending & receiving encoded video bitstream.
••Clickencoded Master text styles packets of size
The to edit bitstream is made into
–Second to be
1300 byteslevel transmitted over network.
•Third packet_struct defines the packet header.
• Structure level
–Fourth level
»Fifth level
#define DATA_SIZE1300
typedef struct packet_struct
{
int seq_no;
int packets;
int data_len;
}packet_struct;
20. Video Transmission Over Ethernet Using H.263 Codec |
2013
PACKETIZATION
• The packets are formed after attaching the packet
•Click toto data.
header edit Master text styles
–Second level
• The packets are pushed into the queue to be
•Third level
transmitted over the network.
–Fourth level
PACKET QUEUE
»Fifth level
21. Video Transmission Over Ethernet Using H.263 Codec |
2013
PACKETIZATION
/* to count the number of packets */
•Click to edit% data_size) styles
if(data_length
Master text
–Second level
total_packets = data_length/data_size+1;
•Third level
else –Fourth level
total_packetslevel
»Fifth = data_length/data_size;
• At the receiver side the incoming packets are pushed
in the queue until the complete buffer is received.
22. Video Transmission Over Ethernet Using H.263 Codec |
2013
PACKETIZATION
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
23. Video Transmission Over Ethernet Using H.263 Codec |
2013
PACKETIZATION
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
24. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO DECODING
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
25. Video Transmission Over Ethernet Using H.263 Codec |
2013
VIDEO DECODING
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
26. Video Transmission Over Ethernet Using H.263 Codec |
2013
OUTPUT
•Click to edit Master text styles
–Second level
•Third level
–Fourth level
»Fifth level
Captured Image Decompressed Image
27. Video Transmission Over Ethernet Using H.263 Codec |
2013
COMPRESSION RATIO
• The size of a single YUV frame (176x144) is about 50KB.
• The captured YUV frame is converted to RGB (176x144)
•Click to edit rendered for display.
Bitmap image Master text styles
–Second level
• The size of a single RGB frame is about 75 KB.
•Third level
• The size–Fourth level
of compressed bitstream for a single frame is
~9.6 KB. »Fifth level
CR = Compressed Size / Uncompressed Size
CR= 9.6 / 49.5 = 0.19 ~ 0.2
• The image is thus compressed nearly by 5 times with
respect to the original one.
28. Video Transmission Over Ethernet Using H.263 Codec |
2013
Quality Measurement & PSNR
• •Click(Peak Signal to Noise Ratio) calculation of two
PSNR to edit Master text styles
images, one level
–Second original and an altered image, describes
how far two level
•Third images are equal.
• A higher–Fourth level
PSNR would normally indicate that the
»Fifth level
reconstruction is of higher quality.
. PSNR formula
MSE: Mean-Square error.
x: width of image.
y: height.
29. Video Transmission Over Ethernet Using H.263 Codec |
2013
Quality Measurement & PSNR
The Peak Signal to Noise Ratio (PSNR) for a QCIF Frame
•Click to calculated at text styles
(176x144) is edit Masterdifferent frame rates say 25 fps,
–Second level
30fps.
•Third level
Component
–Fourth level PSNR(dB)
»Fifth level
PSNR_Y 30.74
PSNR_Cb 29.95
PSNR_Cr 30.58
PSNR at 30 fps
30. Video Transmission Over Ethernet Using H.263 Codec |
2013
Quality Measurement & PSNR
Component PSNR(dB)
•Click to edit Master text styles
PSNR_Y 31.16
–Second level
PSNR_Cb
•Third level 30.47
–Fourth level
PSNR_Cr 29.79
»Fifth level
PSNR at 25 fps
31. Video Transmission Over Ethernet Using H.263 Codec |
2013
References
[1] ITU-T Draft H.263, “Video Coding for Low Bit Rate
Communication”, May 1996.
•Click to edit Master text styles
–Second level
[2] Michael H. Schimek, “V4L2 (Video for Linux 2)
•Third Revision 0.24”, 2008.
Specifications:level
–Fourth level
»Fifth level
[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.
32. Video Transmission Over Ethernet Using H.263 Codec |
2013
References
[5] Ismail Erturk, Yildiray Yalmal, “A new color image quality
measure based on YUV transformation and PSNR for human vision
•Click to edit Master text styles
system”, Department of Computer Engineering, Turgut Ozal
–Second level
University, Turkey, 2011.
•Third level
[6] Karel –Fourth level
Rijkse, “H.263: Video Coding for Low-Bit-Rate
»Fifth level
Communication”, KPN Research, IEEE Communications Magazine,
pp.42-45, December 1996.
Editor's Notes
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec
Video Transmission Over Ethernet Using H.263 Codec