mpeg + rtp
Embed Size (px)
DESCRIPTION
MPEG + RTP. Previously, on CS5248. MPEG Compression Sequence, GOP, Picture, Slice, Macroblock, Block, DC/AC Coefficient I-Frame, P-Frame, B-Frame. MPEG Frame Sizes. Constant Bitrate (CBR) vs. Variable Bitrate (VBR). Previously, on CS5248. RTP headers - PowerPoint PPT PresentationTRANSCRIPT
-
Previously, on CS5248MPEG CompressionSequence, GOP, Picture, Slice, Macroblock, Block, DC/AC Coefficient
I-Frame, P-Frame, B-Frame
-
MPEG Frame SizesConstant Bitrate (CBR) vs. Variable Bitrate (VBR)
-
Previously, on CS5248RTP headersSSRC, Media Timestamp, Marker Bit, Payload Type ..
Application-Level Framing
-
You are HereNetworkEncoderSenderMiddleboxReceiverDecoder
NUS.SOC.CS5248-2009Roger Zimmermann (based in part on slides by Ooi Wei Tsang)
Application-Level Framing
-
How to send/recv?
Let the application decide, not protocol stacks.Tennenhouse + Clark
-
Application Knows BestHow to reorder packetsWhether to ignore lossWhich packet to retransmit
-
Application Data Unit (ADU)Can be processed individually, even out-of-orderUnit of error-recoveryIf part of an ADU is lost, the whole ADU is considered lost
8-Bit PCM audio: 1 ADU = 1 ByteMPEG1 Video: 1 ADU =
-
How to chop data into packets?Every received packet should be useful (even in very lossy environments)
Ideally, 1 ADU in 1 packet
-
RTP Payload HeaderRTP HeaderRTP Payload HeaderRTP PayloadMPEG-1? 2?Temporal ReferenceI? P? B?Begin of Slice? End of Slice?
-
RTP HeaderMedia Timestamp: 32 bitsthe instant the first byte in this packet is captured90 kHz timestamp (90000 = 1 second)
-
RTP HeaderMarker Bit:1 if contains the last byte of a frame
-
RTP HeaderPayload Type: 7 bits32 for MPEG-1
-
RTP Payload HeaderMBZ (5 bits)Unused. Must be 0
-
RTP Payload HeaderT (1 bit)1 if there is a MPEG-2 Extension Header after this header.
-
RTP Payload HeaderTemporal Reference (10 bits)The frame number of the current frame within the GOP
-
RTP Payload HeaderAN bit and N bitSet to 0 for MPEG-1
-
RTP Payload HeaderS (1 bit)Is there a sequence header in this packet?Repetition of sequence header is useful for resynchronization
-
RTP Payload HeaderBS (1 bit) and ES (1bit)BS is 1 iff the first byte of this payload is a slice headerES is 1 iff the last byte of this payload is the end of a slice
-
RTP Payload HeaderPicture Type (3 bits)I (1), P (2), B (3), D (4)
-
RTP Payload HeaderMotion Vectors InformationGet from most recent picture header
-
Fragmentation RulesSequence header: at the start of payloadGOP header: at the start of a payload (or follows Sequence header)Picture header: at the start of a payload (or follows Sequence/GOP header)
-
Fragmentation RulesA slice must be eitherFirst data in the packet, orFollows integral number of slices
A slice may be fragmented if exceeds the size of a packet
-
Packet Size1 MTU is 1500 bytesIP HeaderUDP HeaderRTP HeaderRTP Payload HeaderPayload Size =
NUS.SOC.CS5248-2009Roger Zimmermann (based in part on slides by Ooi Wei Tsang)
ProjectPacketize MP3 or Speex audio into RTP Packets
-
GoalUse the Yima Personal Edition streaming media server codeModify the yimasplit utility, which creates data blocks containing pre-computed RTP packetsServer reads data blocks and sends out RTP packetsModify client to decompress and play audio
-
Project HomepageDescriptionsYima Personal Edition Code on CD-ROMDocumentationIVLE Forums
-
AdviceThe Yima PE source code is not very well documentedSelect your own project, or do the suggested oneEither way: Start early