流媒体基础知识 - HTTP 与 RTMP [英] Media streaming basics - HTTP vs RTMP

查看:72
本文介绍了流媒体基础知识 - HTTP 与 RTMP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对媒体流很陌生,我有一些基本的疑问需要澄清:

I am very new to media streaming, and I have some basic doubts to clear :

  1. 据我所知,HTTP 流媒体(例如通过 Apache)和 RTMP 流媒体(通过 Red5)之间的区别在于流媒体服务器提供缓冲和高级控制,如搜索等.我说得对吗?

  1. 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 ?

我可以只从像 Red5 这样的 RTMP 服务器流式传输 Flash 视频吗?如果我必须流式传输不同格式的文件,我是否必须使用 HTTP 流式传输?我可以使用xuggler之类的工具动态转码文件并根据Red5服务器的请求发送吗?

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 ?

我提出所有这些疑问是因为我必须向所有移动客户端提供流媒体服务 - iPhone、Blackberry、Android - iPhone 不支持 Flash,所以选择 Red5 是个好主意吗?

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) 什么是流媒体".通常在视频流世界中,帧是根据实时传输的.如果您有 30 分钟的视频,它将在 30 分钟内传送给用户.

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.

有专门用于流媒体的特殊协议:RTSP(也许是今天的古老协议)、RTMP、MJPEG、基于 http 的协议系列(apple、abobe、microsoft)和其他一些封闭的供应商协议.

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) 什么是http-streaming"或pseudo-streaming".如果你只是把你的文件放在 HTTP 服务器上,用户可以下载它并观看.如果他下载完整的视频,他甚至可以在里面寻找.但是如果用户想在不下载第一部分的情况下寻找电影中间会发生什么?它应该以某种方式告诉服务器:打开文件容器,寻找这一刻并将文件打包回来.因此,HTTP 服务器必须知道文件容器的结构才能向客户端提供搜索功能.

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 和 apache 可以为 flv 和 mp4 容器做这件事,100% 的视频都可以,可以通过 Flash Player 播放.

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) 现在什么是 http-streaming.Apple、Adobe 和 microsoft 已经在 HTTP 之上设计并实现了流式传输.这意味着客户端下载 10 秒的片段,仍然保持适当的帧速率.30 分钟的电影仍会在 30 分钟内下载,但分段下载之间存在较大延迟.可以在这种格式"中搜索,切换比特率等.

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 流媒体服务器如 Red5 或 erlyvideo 可以流式传输 H.264、H.263、VP6 和 Screen 视频.不支持 MPEG-4 (Xvid/DivX) 或 MPEG-2.

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.

这篇关于流媒体基础知识 - HTTP 与 RTMP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆