Results 1 to 2 of 2

Thread: Wowza stream time measurement without spamming additional threads

  1. #1
    Join Date
    Jul 2015

    Default Wowza stream time measurement without spamming additional threads

    Hi, I've just asked a question on stackoverflow, but I guess here is also good to ask.

    I'm trying to write module which will monitor how long did user watch stream. It's not live stream, but a video on demand.

    My question is what is most efficient way to do so. I went this route:

    created class that implements IMediaStreamActionNotify2 and then when onPlay event is triggered I would create new thread that would periodically check for elapsed time since the start of the stream and update duration variable.

    This is the way I decided to run additional thread:

    BalanceTimerMonitor btm = new BalanceTimerMonitor(...);

    ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
    executor.scheduleAtFixedRate(btm, 0, 5, TimeUnit.SECONDS);
    BalanceTimerMonitor implements Runnable

    Now all of this works, but I'm concerned about amount of new threads created for every stream, since I assume that each stream already runs as separate thread from main wowza app. Will this big amount of threads slow down my server? Is there another more elegant way of measuring stream duration?

  2. #2



    The simplest way would be to run a single timer on the application (you could use your executor) and have it check all of the clients running on the application.

    Each client object has a time running counter that you can check quickly.


Similar Threads

  1. Streaming to mobile without external encoder possible on Wowza without using Speex?
    By ColonelMillerSG21 in forum Live Streaming and Encoders
    Replies: 7
    Last Post: 03-25-2015, 09:21 AM
  2. Network Throughput Measurement
    By guinoz in forum Wowza Streaming Engine in the Cloud
    Replies: 2
    Last Post: 10-24-2014, 12:35 PM
  3. Replies: 3
    Last Post: 10-13-2014, 10:06 AM
  4. Live Stream Record 3: Leaking threads?
    By Romanas in forum AddOn: Other AddOns
    Replies: 3
    Last Post: 12-24-2013, 08:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts