将FMS RTMP直播流转换为黑莓的RTSP



有没有办法将 RTMP 直播流从 FMS 4.5 转换为 RTSP 用于黑莓应用程序?我部署了FMS 4.5服务器,希望通过本机应用程序向BlackBerry用户启用实时流式传输,根据BlackBerry文档,唯一可以在BlackBerry设备上支持实时流式传输的协议是HTTP和RTSP。

黑莓支持媒体流

你可以在cgi中使用rtmpdump并写入stdout,不会是rtsp,只是http。这就是我如何在没有闪存的情况下从NBC播放rtmp流的方式。使用 rtmp 流作为参数调用脚本。如:

http://example.com/cgi-bin/nbc.cgi?nbcv=url-minus-domain/movie.mp4

#!/usr/bin/env python
import cgi
import subprocess
rtmpdump='/usr/local/bin/rtmpdump';
# use the quiet switch we are writing the video to stdout.
quiet='-q';
# swf verification
swfUrlswitch='-s';
swfUrl='http://www.nbc.com/assets/video/3-0/swf/NBCVideoApp.swf';
rtmpUrlswitch='-r';
rtmpbase= 'rtmp://cp81777.edgefcs.net/ondemand/';
# grab the argument
a=cgi.FieldStorage()
rtmpUrl=rtmpbase+a.getvalue('nbcv');
pargs=[rtmpdump,quiet,swfUrlswitch,swfUrl,rtmpUrlswitch,rtmpUrl]
# http headers 
if rtmpUrl[-3:]=='mp4':
    print 'Content-Type: video/x-mp4'
if rtmpUrl[-3:]=='flv':
    print 'Content-Type: video/x-flv'
# make sure you print a blank line after the header.
print ''
# call rtmpdump
subprocess.Popen(pargs)

最新更新