本文介绍了new.livestream.com API 获取 RTSP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取 livestream.com 帐户的 RTSP 流.我正在阅读 livestream.com 的一些 API 文档,但他们有一个新网站 (new.livestream.com),我找不到任何关于此的 API 文档.有谁知道新的 livestream.com 网站是否有允许我获得 RTSP 流的 API?提前致谢.

I need to get an RTSP stream of a livestream.com account. I was reading some of the API documentation for livestream.com, but they have a new website (new.livestream.com), and I cannot find any API documentation talking about that. Does anybody knows if there is an API for the new livestream.com website which allows me to get an RTSP stream? Thanks in advance.

推荐答案

我知道这有点老了,但我问了同样的问题,我就是这样做的:

I Know this is a bit old, but i was asking that very same question and i this is how i've done it:

我找到了这个用于新直播的 URL/API 调用,以获取事件流的详细信息

I've found this URL/API call, for the new livestream, to get the details of an event's stream

http://new.livestream.com/api/accounts/[account_id]/events/[event_id]/viewing_info

这会为您提供包含该事件流的详细信息的 JSON 响应,包括 RTSP 流的 URL (streamInfo -> rtsp_url)

This gives you a JSON response with details of streams for that event, including the URL of the RTSP stream (streamInfo -> rtsp_url)

请务必在播放直播活动之前调用此方法,因为 URL 会不时更改(我认为他们使用某种负载平衡/CDN 网络或其他方式)并且您每次都应该获取最新的 URL.

Just be sure to call this before playing a livestream event, because the URL changes from time to time (i think they use some sort of load balancing/CDN network or something) and you should get the latest URL each time.

顺便说一句:要获得 [account_id] 和 [event_id],只需查看 new.livestream.com 中事件的 URL,URL 类似于

BTW: To get the [account_id] and [event_id] just look at the URL of an event in new.livestream.com the URLs are something like

  • http://new.livestream.com/accounts/[account_id]/events/[event_id]
    • [account_id][event_id] 都是数字
    • http://new.livestream.com/accounts/[account_id]/events/[event_id]
      • [account_id] and [event_id] are all numbers

      • http://new.livestream.com/[account_id]/事件/[event_id]
        • [account_id] 是一个名称(如 'tedx'),[event_id] 是所有数字
        • http://new.livestream.com/[account_id]/events/[event_id]
          • [account_id] is a name (like 'tedx') and [event_id] is all numbers

          • http://new.livestream.com/[account_id]/[event_id]
            • [account_id][event_id] 都是名称(如tedx/WallStreet")
            • http://new.livestream.com/[account_id]/[event_id]
              • [account_id] and [event_id] are both names (like 'tedx/WallStreet')

              另外,我不确定这是否是一个公共 API,但它现在有效.

              Also, i'm not sure if this is a public API, but it works for now.

              这篇关于new.livestream.com API 获取 RTSP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 21:14