Jump to content
  • 0

How would I solve this use case? Multiple podcasters broadcasting on RTMP, enforcing a time slot.


Conspyre
 Share

Question

I'm setting up a broadcast network type situation where I have podcasters on time slots, and want to enforce that time slot so that, for example podcaster A ends at 4:59.59 and podcaster B gets access to the stream at 5:00.00. When no podcasters are streaming it should be running a mp4 loop player. 

How to achieve something like this with Ant media?

                 ┌──────────────────────────────────────────────────────────────────────────────────────────┐                          
                 ├───────────────────────────────┐                                        ┌─────────────────┤                          
                 │        Loop player ...        │                                        │  Loop player ...│                          
                 ├───────────────────────────────┘                                        └─────────────────┤                          
┌──────────────┐ │                                ┌──────────────────┐                                      │                          
│ Podcaster 1  │─┼▶                               │  3pm-5pm         │                                      │                          
└──────────────┘ │                                └──────────────────┘                                      │        ┌────────────────┐
                 │                                                                                          │───────▶│ output 1 RTMP  │
┌──────────────┐ │                                                    ┌──────────────────┐                  │        └────────────────┘
│Podcaster 2...│─┼▶                                                   │  5pm-7pm         │                  │                          
└──────────────┘ │                                                    └──────────────────┘                  │                          
                 │                                                                                          │                          
                 │                                                                                          │                          
                 └──────────────────────────────────────────────────────────────────────────────────────────┘                          

                                   

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
On 10/13/2022 at 8:26 AM, Conspyre said:

I'm setting up a broadcast network type situation where I have podcasters on time slots, and want to enforce that time slot so that, for example podcaster A ends at 4:59.59 and podcaster B gets access to the stream at 5:00.00. When no podcasters are streaming it should be running a mp4 loop player. 

How to achieve something like this with Ant media?

                 ┌──────────────────────────────────────────────────────────────────────────────────────────┐                          
                 ├───────────────────────────────┐                                        ┌─────────────────┤                          
                 │        Loop player ...        │                                        │  Loop player ...│                          
                 ├───────────────────────────────┘                                        └─────────────────┤                          
┌──────────────┐ │                                ┌──────────────────┐                                      │                          
│ Podcaster 1  │─┼▶                               │  3pm-5pm         │                                      │                          
└──────────────┘ │                                └──────────────────┘                                      │        ┌────────────────┐
                 │                                                                                          │───────▶│ output 1 RTMP  │
┌──────────────┐ │                                                    ┌──────────────────┐                  │        └────────────────┘
│Podcaster 2...│─┼▶                                                   │  5pm-7pm         │                  │                          
└──────────────┘ │                                                    └──────────────────┘                  │                          
                 │                                                                                          │                          
                 │                                                                                          │                          
                 └──────────────────────────────────────────────────────────────────────────────────────────┘                          

                                   

See this https://github.com/ant-media/Ant-Media-Server/wiki/Playlist

Along with that you can use time expiring token and REST APi to enforce strict access time to publishers.

Link to comment
Share on other sites

  • 0

I need a little more guidance. What I have is an RTMP server that is hooked up to a Roku channel. I've tried the loop player on Ant, and it's solid, it connects to the RTMP and plays - and while it is connected, it can't be interrupted by another incoming RTMP connection.

What kind of architecture do I need to set up a prototype of this?

Link to comment
Share on other sites

  • 0

So this pattern is generally known as a radio channel or a tv station channel pattern. This is most common in shoutcast & icecast servers for audio streaming. There are two ways to make this work.

1. There will be one connection endpoint and one stream name constant. You will be changing media & source on the publisher side transparently. Sometimes you publish from an encoder sometimes pull from a different source sometimes from a serverside playlist. But to subscriber it wont matter because the stream name is same. they can only see or hear changing content / blank  / adverts etc. the important thing here is that you don't close the channel on server side, unless it has been idle for a specific amount of time. Thus when you change source the player does not disconnect. Now it is dependent on whether the media server supports this pattern or not. There are some media servers that can do this.

2.  Another way this is handled is through clever client side logic. In this technique i assume your server cannot keep the channel open when there is no content (it closes immediately). In this case what you do it whenever you publish & unpublish the stream, you track it in a database. The player will use ajax or websocket to check with the server about the availability/unavailability of the stream. Whenever the stream becomes available the player will reconnect and continue to play. But even in this case you don't change the stream name. just stop previous publish and start new publish. There are also some media servers that can switch to streams without disconnecting.

Honestly i am a bit new to Ant media server myself so perhaps one of the team members can confirm which way will be best for developing such a pattern with ant media server. there is also this interesting article related to this subject.
 

 

 

  • Like 1
Link to comment
Share on other sites

  • 0

I've been through this article & gotten this much set up and running. It's pretty straightforward.

In my case, client side logic is not an option - the RTMP server in question is serving clients over a Roku channel - so it seems the server side is the only option for this use case.

I'm thinking the solution involves something running on a scheduler which drives commands into Ant... and looking for pointers to docs or samples that do something similar.

Link to comment
Share on other sites

  • 0

@ConnessioneCould something like this work? Create N "Input" RTMP connections on the Ant media server (one for each podcaster), and 1 "Output" RTMP connection who's output is the next RTMP upstream feeding Roku. A scheduler fires off a task that switches the input of the "output" RTMP to the output of one of the "input" RTMPs. Basically a N:1 switch.

Link to comment
Share on other sites

  • 0

Well technically that is how the server side implementation works in media servers. There may or may not be a scheduler in place. But the pipelines work somewhat like that. there is a single pipeline from server to client and there are multiple ways to inject content into it (vod/live). The playlist mechanism cannot play the live stream but it can play the other type of sources that the media server may support. 

A simple use case of this is when you are streaming live content and in between you have commercial breaks where you switch to play some kind of video ad file that you have on your server. When ad finishes you get back to live. A rough sketch would be like this:

image.thumb.jpeg.ede36b5362e5b186730720673eff7b9c.jpeg

But then again i dunno if ant media can mix live and VOD on one stream like a playlist. Perhaps someone from the team can say better.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...