如何从RTMP服务器获取视频流到Android



我想从RTMP服务器实现流式传输。例如,下面是RTMP服务器的链接。

http://usher.justin.tv/find/CHANNELNAME.json?type=any

并想做它的流媒体。

我找到了一种方法:它连接到Twitch服务器上的SWF文件(速度太慢)。。。如何将其从rtmp://转换为VideoView以避免使用Twitch API?

请求后回答:

[
{"节点":"video10-2.arn01","needed_info":","播放":"jtv_FO2coLXGNLzCXtvR","meta_game":"暗黑破坏神III:灵魂收割者","video_height":720,"比特率":2915.1875,"broadcast_part":5,"rank":0,"persistent":"true","cluster":"arn01","justin.tv","jtvx.com","xarth.com",\"twitchtv.com\",\"twitch.tv",\"newjtv.com\",\"jtvnw.net\",\"wdtinc.com\",\"imapweather.com\","facebook.com\"、\"starraching.com\"],\"streamName\":\"jtv_FO2coLXGNLzCXtvR\",\"expiration\":1385121067,\"server\":"video10-2.arn01\"}","connect": "rtmp://192.16.65.94/app","broadcast_id":7587457488,"type":"live","display":"Source","find_type":"dist"},
{"节点":"video12-1.fra01","needed_info":","播放":"jtv_LuAij7o0_zozQ4jY","meta_game":"暗黑破坏神III:灵魂收割者","video_height":720,"比特率":1600,"broadcast_part":1,"rank":1、"persistent":"true","cluster":"fra01"、"token":"b4db7f59d3b4d723624ee50ed2d69519d1a4cebb:{\"swfDomains\":[\"justin.tv\",\"jtvx.com\",\xarth.com\",\"twitchtv.com\","twitch.tv\",\newjtv.com\","jtvnw.net\",\"wdtinc.com\",\"imapweather.com\","facebook.com\"、\"starmacratching.com\"],\"streamName\":\"jtv_LuAij7o0_zozQ4jY\"、"过期\":1385121067,\"服务器\":"video12-1.fra01\"}","connect": "rtmp://199.9.254.232/app","brodcast_id":7587458496,"type":"high","display":"high","find_type":"dist"},
{"节点":"video15-2.arn01","needed_info":","播放":"jtv_e38UUDs1WLMP9wlc","meta_game":"暗黑破坏神III:灵魂收割者","video_height":360,"比特率":350,"broadcast_part":1,"rank":3,"persistent":"true","cluster":"arn01",\"jtvx.com\",\"xarth.com\"、\"twitchtv.com\"、"twitch.tv\"、\"newjtv.com\","jtvnw.net\",\"wdtinc.com\",\"imapweather.com\","facebook.com\"、\"starmacratching.com\"],\"streamName\":\"jtv_e38UUDs1WLMP9wlc\"、"expiration\":1385121067,\"server\":"video15-2.arn01\"}","connect": "rtmp://192.16.65.99/app","broadcast_id":7587458512,"type":"low","display":"low","find_type":"dist"},
{"节点":"video12-1.fra01","needed_info":","播放":"jtv_bRMbL_ROsoHAegM2","meta_game":"暗黑破坏神III:灵魂收割者","video_height":480,"比特率":800,"broadcast_part":1,"rank":2,"persistent":"true","cluster":"fra01",",\"jtvx.com\",\"xarth.com\",\"twitchtv.com\","twitch.tv",\"newjtv.com\","jtvnw.net\",\"wdtinc.com\",\"imapweather.com\","facebook.com\"、\"starmacratching.com\"],\"streamName\":\"jtv_bRMbL_ROsoHAegM2\"、"expiration\":1385121067,\"server\":"video12-1.fra01\"},"connect": "rtmp://199.9.254.232/app","broadcast_id":7587458528,"type":"media","display":"medium","find_type":"dist"}]

我发现了在PC上获取流的最佳方法:在VLC中观看twitch.tv/justin.tv/own3d.tv流。

它使用以下PHP代码:http://bog.no-ip.biz/sc2/stream2vlc.php

但我不知道如何在Android项目中实现它。

您可以使用可以在Android上运行的Adobe AIR SDK。它非常简单,默认情况下可以使用RTMP。

由于WebView支持RTSP,也许您可以随时将流从RTMP转换为RTSP。

我没有尝试过,但一个网络搜索给了我这个例子:RTMP到RTSP使用wowza和xuggler重新流式传输。

相关内容

  • 没有找到相关文章

最新更新