Wowza Community

Suggestions on building delaying timeshift module

Hello wowza community,

Im a java programmer and im looking to develop a timeshifting module that delays a live stream for 6 hours and re stream it out in rtmp.

My question is what would be the best approach for this ?

I know wowza has built in recording for live streams and a lot of different modules and theres probably many ways of doing this, so please any suggestions I really appreciate it.

There are two approaches, and you might combine them.

First, Wowza’s nDVR features will work. nDVR has a WindowDuration setting that will be important, how much of the recording is preserved. Then to enforce the 6 hour delay you can use the Playlist Request API

The other approach is using Wowza Live Stream Record and its segmentation features, and this scheduler,which can use files as the source for a live stream rather like a re-run in that everyone sees the stream as live, though it is a file source. You might record in 1 or 2 hour segments, that will feed this schedule. You might work out some naming convention such that the schedule can remain static, but the files it uses are changing because of your re-naming scheme. To facilitate the naming scheme, take a look at IMediaWriterActionNotify

I think the 2nd approach makes more sense for a 6 hour delay. It should be more manageable, precise and the recordings are portable whereas the nDVR recordings are chunked and not useful for other purposes.

Richard

If the scheduler is not flexible enough for your system, you will want to have a look at the Stream class API that it uses.

Richard

You’re welcome. Let us know how it goes, and of course if you have more questions

Richard

Hi Bob,

Make sure production server is properly tuned. And I would align Java and Wowza versions on both sides.

Richard

If the scheduler is not flexible enough for your system, you will want to have a look at the Stream class API that it uses.

Richard

thank you Richard this is very helpful

Hi Richard,

I finished the timeshift module and everything worked well but we are experiencing one problem with system memory and not the heap.

The module works fine on my development environment windows and it doesn’t consume much memory but on our production server Ubuntu 64but with 24gb memory it uses all memory as cache in a matter of an hour, i tired JMX to see what is wrong but dpnt see anything.

I had to clear through crontab every hour ‘echo 3 > /proc/sys/vm/drop_caches’, I’m assuming this not right thing to do is there anything else that could try to have it run normally ?

Yes my wowza is tuned and running on the latest 4.0.3

here is what i have:

OS Architecture

amd64

Memory

Total: 31.39 GB

Available: 23.34 GB

Processor Cores 24

Java Version 1.7.0_55

Java Bitness 64

Java Heap Size

Production level 10000 MB

Java Garbage Collection Settings

Concurrent collector (recommended) -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=512m

Handler Thread Pool Size

Set automatically to: 600 threads

Transport Thread Pool Size

Set automatically to: 400 threads

Net Connections Processor Count

Set automatically to: 32 threads

Media Caster Processor Count

Set automatically to: 32 threads

Idle Worker Count

Set automatically to: 24 threads

Unicast Incoming Processor Count

Set automatically to: 24 threads

Unicast Outgoing Processor Count

Set automatically to: 24 threads

Multicast Incoming Processor Count

Set automatically to: 24 threads

Multicast Outgoing Processor Count

Set automatically to: 24 threads

Client Idle Frequency 250 milliseconds

RTP Idle Frequency 75 milliseconds

Hi there, I think for quicker and more accurate assistance it would be best to open a ticket.

Please delete you access logs [install-dir]/logs/wowzastreamingengine_access.log, restart Wowza run a quick test and zip up your /conf and /logs folders. Send them to support@wowza.com.

Also please include a link to this thread as reference.

Salvadore