Skip to main content

Double valued timestamp

Answered

Comments

3 comments

  • Andrey Terentyev
    • Network Optix team

    Hello Jason,

    objectMetadataPacket->setTimestampUs(timeus);

    How do you get/calculate teimus? Could you provide the whole compilable code?

    0
  • Jason Shim

    Hello Andrey,

    The timestamp is raw timestamp from the camera.

    I can provide the source code. But it isn't a public domain.

    Give me your email and I'll send you the source code.

     

    0
  • Andrey Terentyev
    • Network Optix team

    Here timestamp examples

    You can see timestamps in the following logs.
    Numbers like 1680746176021568 are timestamps in microseconds.
    And I attached a capture of object_detection db.
    You can find wrong timestamps like 3361462349351 in milliseconds.

     

    But NX VMS records wrong timestamp, and also displays the wrong timestamp.

    If your assumption is correct, and there is something inside the Server code, then the timestamp value has no importance and the issue would appear with any timestamp value, including the same constant value.
    That also would mean we can use any plugin for troubleshooting. For example, sample_analytics_plugin.
     
    I performed the following test.
     

    • I took the sample_analytics_plugin and the value of 1680746176021568 you've shared.
    • Refactored the code of DeviceAgent::generateObjectMetadataPacket() like this
    #include <nx/kit/debug.h>

    ...


    // Bind the object metadata to the last video frame using a timestamp.
    // objectMetadataPacket->setTimestampUs(m_lastVideoFrameTimestampUs);
    NX_PRINT << "m_lastVideoFrameTimestampUs: " << m_lastVideoFrameTimestampUs << " preset timestamp: " << 1680746176021568;
    objectMetadataPacket->setTimestampUs(1680746176021568);

    Thus, the plugin would produce on object with the same constant timestamp value of 1680746176021 in milliseconds. 

    • Rebuilt the plugin and copied to the Server. 
    • Restarted the Server.
    • Disabled all plugins on all cameras, but the sample_analytics_plugin on a single camera.
    • Enabled analytics logging for Nx Desktop

    https://support.networkoptix.com/hc/en-us/articles/360058902133-Analytics-Logs-Monitoring-Metadata-Flow

    • Restarted Nx Desktop
    • Opened the camera on the scene.
    • Enabled sample analytics plugin on the camera.
    • Navigated to the "Objects" tab in the right panel.
    • Configured analytics log file monitoring

    analytics logfile names starting with rtp_parser_AnalyticsPanel would contain object information displayed in the right panel.
    The command below would give me records of object with the timestamp different from 1680746176021.

    tail -F 'rtp_parser_AnalyticsPanel@0x7facc8020e00_device_c9c5f33e-c5d2-a425-3681-46bfd3ab2eb4_high.log' | grep  metadataTimestampMs | grep -v 1680746176021

    [Expected result]
    If the assumption is correct, I would see log records displayed in the console, which would mean the Server of the Nx Desktop modifies the timestamp.
    According tho your screenshot, the records would appear quite soon.
    Otherwise, if there are no log records displayed, the assumption is wrong.
    That would mean there is no issue in the Server code, neither in the Nx Desktop code with the same static timestamp value.
    That would mean the issue appear when timestamp value changes.
     
    [Actual result]
    There are no records displayed in at least 10 minutes. That means the root cause it not in the Server or the Nx Desktop code.
    See the log file attached.
     
    Most probably, the issue is caused by the camera sending wrong timestamps.
    Please, proceed with the test described using sample analytics plugin and your plugin.
    While testing using your plugin, you could grep for the records with timestamp values beginning with 33614 or not beginning with 168074.
    Please your results and share the analytics log files of both tests.

    0

Please sign in to leave a comment.