Wowza Community

Live stream caching to an hour later like plus one service

Hi,

I am not sure if its right place to ask.

Basically we have live stream running on wowza. We want to add a plus one service, so play the same stream but an hour later.

What is the best method to achieve this.

thanks

isn’t that possible to build into a script?

just an idea.

when a live stream starts you have a datetimestamp of when the stream started. build into your script that from that datetimestamp + 1 hour you will send the live stream.

i dont know what your setup is though.

  • is the livestream public available?

  • can i view the livestream on lets say vlc/winamp (or something else)? so get the stream straight from the wowza server. that would make it harder to script.

  • if you run it on flash player you should be able to build it in. you might need a database and some scripting language for it.

so it depends a bit on what your setup would look like.

maybe there is a much easier solution. i dont know :wink:

thanks for the reply. i think you misunderstood the question.

I have one live stream running. i want to add an additional channel to play same stream but an hour late.

So second channel would be playing same stream but an hour delayed.

thanks

It is not possible to delay the stream by that much without doing some custom work.

Basically what you would need to do is store the packets from the incoming stream somewhere and then play them out in a separate stream one hour later.

The following package does this for short delays by storing the packets in memory however for a one hour delay, this would use too much memory so you would need to write them to disk and retrieve them later. Apart from that, the process is pretty simple for a developer to implement.

http://www.wowza.com/downloads/forums/publishwithdelay/PublishWithDelay.zip

Other options are to use segmented recordings of the original stream and then use the Streams api to feed the delayed recordings into a new stream later on. This would also need some custom work.

Roger.

Hi,

How I have done this in the past is to to use segmented recording where the segment duration divides evenly into the delay time. e.g for 60 minute delay, have 10, 15 or 20 min segments. You need at least 2 extra segments as you cannot be writing to the same one you are reading from and there may be some slight timing issues where the recorder doesn’t finish exactly on time or the switch occurs a few seconds early.

If you use a custom File version Delegate then you should be able to have your recorder automatically overwrite the old file names so would make the playback side simpler.

See https://www.wowza.com/docs/how-to-record-live-streams-wowza-streaming-engine for Wowza Media Server <= 3.6.4 or https://www.wowza.com/docs/how-to-start-and-stop-live-stream-recordings-programmatically-livestreamrecordautorecord-example#advancedexample for Wowza Streaming Engine >= 4.0

Once you have the recordings, You create a stream using the Streams api that has all of the segments in it’s playlist. It should initially start offset from the recorder and as long as recording continues properly, it should never catch up.

If you need assistance, I suggest asking on the consultants forum area or have a go and ask here if you need guidence.

Roger.

If you are streaming over RTMP only you can use start and duration as shown in this example:

How to insert a pre-roll or mid-roll for video on demand playback in Flash RTMP client

If streaming over HTTP:

How to specify a play start time and duration for HTTP streaming

Salvadore

i think that would be a problem, because a live stream is as it says a live event.

you can’t show previous images/stream from a live event.

i dont know how to program that though or if it is even possible when recording it.

we have live stream publicly available. but playing via jwplayer.

if i capture a datetimestamp+1, how stream would start from that point. do i need to cache it or record as archive?

thanks for the reply. i think you misunderstood the question.

I have one live stream running. i want to add an additional channel to play same stream but an hour late.

So second channel would be playing same stream but an hour delayed.

thanks

Thanks for the reply Roger,

I think storing as segmented recording would fit in our case.

Just to understand the custom work involved, I would be storing 55 min segmented files and then generating a playlist to play in separate stream.

To understand the work,

  1. can i add item in playlist on the fly.

  2. what custom work would require to play this playlist.

I would appreciate any help/

thanks

Tariq