Streaming Video: An Overview
RTP is the answer
RTP (Real-time Transfer Protocol) transmits data in real time. What this means is a one-minute video is transmitted in one minute. This protocol is layered not on top of TCP/IP but on top of UDP (User Datagram Protocol). RTP has little or no error correction so if there is a hiccup in the data transfer, the packet is simply dropped and “tough beans to you”. You have probably seen this in live web casts where the stream seems to “skip a beat” because they simply are not possible without this “tough beans” approach.
The flip side of this is the video is streamed at a constant data transmission rate that matches the video’s data rate. This why broadband connections work so well, there is always room in the pipe for other stuff to go on in the background and why many developers allow you to choose your connection- dial up or broadband. They can “feed” you the video at a rate that matches your connection.
RTSP is an even better answer
RTP is a one-way stream. It moves from there to here. RTSP (Real Time Streaming Protocol) is a two way stream. Data moves from there to here and from here to there. RTSP uses TCP to communicate but it is layered on top of RTP. Flash actually uses a version of this protocol (Real Time Messaging Protocol) when it streams a video or audio from a Flash Media Server to a user’s browser. The two way communication aspect comes into play by allowing you to move data back and forth between your machine and the server. This may sound rather mysterious but you have actually used this protocol when you participated in a Breeze session. My audio and/or video stream is sent to you in real time and you can all see and hear me. There are occasions where I will permit you to use your video or audio device and anyone attending the “Breezo” can see or hear you and me.
Data Rate:
One of the fundamental maxims of working with digital video is this: Data rate controls quality. Bandwidth controls the user experience.
Regardless of which computer platform is used, bandwidth or “the pipe” is your prime consideration and when it comes to creating and playing Flash Video always keep an eye on the pipe.
The pipe can make or break the user’s experience. If he or she has a lot of bandwidth, such as a T1 line in a corporation or High Speed Internet into your home, you can view full length movies with little or no disruption. If you are in a remote or rural situation, the odds are very good you have a dial-up modem meaning your bandwidth is limited.
To wrap your mind around the differences, think of a highway tunnel that goes under a lake. If the tunnel is part of an 8-lane highway, thousands of cars simply approach the tunnel and zip through it at the posted speed. This is because the tunnel’s entrance is the same width as the highway.
Image 13: Information flows through the pipe at a steady rate.
Now abruptly reduce the diameter of the tunnel from four lanes to one lane each way. We have all experienced how infuriating the delay can be as thousands of cars squeeze into one lane of traffic and reduce their speed to a crawl as they approach the tunnel’s entrance and proceed into the tunnel. The cars in this example are data and how fast they move is the data rate. Think of a T1 line as being the tunnel for the 4 -lane expressway and the single-lane tunnel is a dial up service, the highway is the server and the user is the poor guy behind the steering wheel in the car.
Image 14: Restrict the flow and the pipe starts to clog
It goes without saying that when you plan to deliver video you need to have a solid bandwidth strategy in place for the user, the server and the video. The server bandwidth strategy must take into account the maximum number of users that can access the video at any one time. The last thing you need is for your user to get into the middle of a traffic jam waiting to download and view the video.
When it comes to the user, you need to be aware of the width of the tunnel up ahead. You need to leave enough room for the data stream but also other internet activities. Not doing this is quite similar to having a transport truck sitting at the side of the road and jutting out into traffic. Things will stop or seriously slow down as the cars reduce their speed to avoid driving into the back of the truck. In a dial up situation a user with a 56.6 K connection can drive along the highway at 56.6 Kbps. When it comes to video a target data rate of 40Kbps is normal which leaves room for other activities.
So what is data rate? Data rate is simply the amount of data (cars on a highway) transferred per second to the user’s computer. This, in turn, determines the bandwidth required to play the video. The data rate calculation is :
Date rate = (w X h X color depth X frames per second) / compression.
Let’s do the data rate calculation for the Tortoise video used in this course. The video’s values are:
-
Width = 320
-
Height = 240
-
Color depth = 24
-
Frames per second = 15
-
Compression = 60. The benchmark compression ratio for both Flex and Squeeze is 60:1.
Data Rate = (320 x 240 x 24 x 15) /60
Data Rate = ( 27,648,000 ) / 60
Data Rate = 460,800
The data rate for the video at 15 frames per second is 460,800 bits per second or 461 kilobits per second, The second line of the calculation is there for a deliberate reason. If you were to apply no compression to the video you would use a data rate of about 27.6 million bits per second. To deliver that video you would need an internet connection the size of a tunnel between Britain and France. Toss in the compression and the video can safely be delivered to most users.
If you are creating video for internet deliver then use these common data rates for delivery of the FLV to the Flash Player:
Dial Up: 60 kilobits per second
DSL: Between 150 and 300 kilobits per second
Cable: Between 200 and 300 kilobits per second
T1 or T3 line: 150 to 430 kilobits per second
The Flash Player supports a maximum data rate of 4 megabits per second.
One final consideration in regards to data rate is that the number shown in the compression applications is a bit disingenuous. If you use the FLV Encoder and use the Medium Default setting you set the data rate of a video to 400 kbps. This is not the final data rate. Remember, video is composed of both an audio track and a video track. The number you set, affected just the video track. If you look at the data rate for the audio track it was set to 96kKps. This means the data rate for the video is 496 Kbps.
Image 15 . Add the data rate values for both the audio and the video tracks to determine the total data rate for your FLV.


This work is licensed under a Creative Commons License.
