问题
I am very new to media streaming, and I have some basic doubts to clear :
As far as I can understand, the difference between HTTP streaming (say through Apache) and a RTMP streaming (through Red5) is that streaming servers provide buffering and advance controls like seek, etc. Am I right ?
Can I stream only flash videos from RTMP servers like Red5 ? If I have to stream varying formats of files, do I have to go for HTTP streaming ? Can I use tools like xuggler to dynamically transcode files and send according to the request from the Red5 server ?
I am posing all these doubts because I have to provide streaming to all mobile clients - iPhone, Blackberry, Android - iPhone does not support flash, so is it a good idea to go for Red5 ?
回答1:
Let me be a bit verbose to clear details.
1) What is "streaming". Usually in world of video streaming is delivery of frames according to realtime. If you have 30-minutes video it will be delivered to user in 30 minutes.
There are special protocols dedicated exclusively for streaming: RTSP (perhaps the ancient of living today), RTMP, MJPEG, family of http-based protocols (apple,abobe,microsoft) and some other closed vendor protocols.
2) what is "http-streaming" or "pseudo-streaming". If you just put your file on HTTP server, user can download it and watch. If he downloads full video, he can even seek in it. But what happens if user want to seek to the middle of film without downloading first part? It should somehow tell to server: open file container, seek to this moment and pack file back. So HTTP server must know about structure of file container to deliver seek functionality to client.
nginx and apache can do it for flv and mp4 containers, which is ok for 100% of video, possible to play via Flash Player.
3) what is http-streaming messed with nowadays. Apple, Adobe and microsoft has designed and implemented streaming on top of HTTP. It means that client downloads 10-seconds segment, still keeping proper framerate. 30-minutes film is still downloaded in 30 minutes, but there are big delays between segment downloadings. It is possible to seek in such "format", to switch bitrates, etc.
4) RTMP Streaming servers like Red5 or erlyvideo can stream H.264, H.263, VP6 and Screen video. MPEG-4 (Xvid/DivX) or MPEG-2 is not supported.
来源:https://stackoverflow.com/questions/5842808/media-streaming-basics-http-vs-rtmp