Results 1 to 9 of 9

Thread: Time stamps for a stream

  1. #1

    Default Time stamps for a stream

    Hi All,

    I need to find out the time stamps for the first received packet and last received packet for a stream.

    For example I have created a live stream on Wowza that's retrieving the stream from a Camera.
    I have my own module that watches the stream events like publish, destroy, etc.
    And let's say that the Wowza server has lost its network connectivity so the stream will be destroyed by Wowza after some timeout period.
    My module gets the destroy event but naturally only after the timeout.
    However, I would like to know the time stamp of the last packet received successfully for that stream.
    I have checked the methods IMediaStream.getElapsedTime().getDate() and IMediaStream.getElapsedTime().getTime().
    But they seem to mark the dates when the destroy event is received so it's after the timeout.

    Is this doable? Or do I have a misunderstanding above?


  2. #2
    Join Date
    Dec 2007


    You might be able to do something with this:


  3. #3


    I have managed to do the above by using the StreamWatchDog approach suggested by you. Thanks.

    Now I need to get another similar information. The timestamp of the FIRST packet received after the stream is established between the live encoder and Wowza.
    I mean the first packet that is incoming to Wowza for a stream...
    I need this to find out the delay between starting a stream on Wowza and receiving a packet from the live encoder.


  4. #4
    Join Date
    Dec 2007


    You can easily see what info is available in the packets using the same example, but I'm not sure how you would accomplish this. Wouldn't the encoder and server time have to be identical?


  5. #5


    You mean by using AMFPacket.getAbsTimecode() or similar methods?
    In the documentation it says only "Get absolute timecode (milliseconds)" for this method.
    I am not sure when it is time stamped, when it is received or after the processing done by Wowza.
    It doesn't matter much though when I think about it. Thanks anyway. I will look into it.

    Yes, as you pointed out, there's the issue about clocks, zones, delays, etc. and we are planning to tackle them too somehow after this first step.


  6. #6


    Hi. Below is the log I printed from within the watchdog.
    First timestamp is taken at the stream publish time. Second one is what I get from the AMFPacket.getAbsTimecode().
    The packet that I use is: AMFPacket firstPacket = (AMFPacket) packets.get(0);

    So could you please let me know what the getAbsTimecode() return value corresponds to? It doesn't look like unix time.
    And how can I get the unix time stamp of the first packet received?
    2012-03-14 12:00:08 EET comment server INFO 200 - Watchdog publish ts=1331719205491 --- first packet ts=1654957285


  7. #7
    Join Date
    Sep 2011


    The getAbsTimecode() is based on the stream up-time (I think) meaning that you can see when the stream was stared (how long ago) in milliseconds.
    I'm not 100% sure but as I said I think that's what its referring to.

    I had a look in the Wowza API but not much info was given.


  8. #8


    Thanks for the reply but I don't think it gives the stream up time.
    If it was then stream up time would be about 460 hours, which is not correct. I had started Wowza just a few minutes ago..and the stream was up only for about a minute.

    I simply need to find out the timestamp of the first RTP packet of a stream that is received by Wowza..
    Any ideas?


  9. #9


    Get the IMediaStream interface to the stream and then you can use stream.getElapsedTime().


Similar Threads

  1. Replies: 7
    Last Post: 06-06-2014, 09:55 PM
  2. live-record time stamps
    By Atmapuri in forum AddOn: Other AddOns
    Replies: 1
    Last Post: 12-13-2013, 12:37 PM
  3. Record files between certain time stamps
    By vineethkdlr in forum General Forum
    Replies: 1
    Last Post: 05-08-2013, 08:01 AM

Posting Permissions

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