VST - Delay Between Live and Recorded Streams on Jetson Orin

I’m using VST version 1.3.0-24.08.1 on a Jetson Orin device.

I noticed a consistent 3–5 second delay between the live stream and the recorded stream, even though the system time appears correct and synchronized.

  • Source stream: FFmpeg with RTSP output
  • Overlay: Real-time clock using drawtext='%{localtime}'
  • Livestream: Viewed through VST WebUI
  • Recording: Done by VST (always_recording: true)
  • Issue: Recorded stream timestamps (visually confirmed via overlay) are delayed by ~5 seconds vs real-time

I’ll attach two frame captures:

  1. Live stream screenshot (with timestamp overlay)

  2. Recorded stream frame (same frame delayed ~5s)

The stream type doesn’t matter - it can be ffmpeg, rtsp live camera, above are only examples

Here is my config

{
    "network":
    {
            "http_port": 30080,
            "server_domain_name":"",
            "stunurl_list": ["stun.l.google.com:19302","stun1.l.google.com:19302"],
            "static_turnurl_list": [],
            "use_coturn_auth_secret": false,
            "coturn_turnurl_list_with_secret": [],
            "use_twilio_stun_turn": false,
            "twilio_account_sid": "",
            "twilio_auth_token": "",
            "use_reverse_proxy": false,
            "use_sensor_ntp_time": true,

            "reverse_proxy_server_address": "REVERSE_PROXY_SERVER_ADDRESS:100",
            "ntp_servers": [],
            "max_webrtc_out_connections": 3,
            "max_webrtc_in_connections": 1,
            "webservice_access_control_list":"",
            "rtsp_server_port": 8070,
            "rtsp_preferred_network_iface": "eth0",
            "rtsp_in_base_udp_port_num": -1,
            "rtsp_out_base_udp_port_num": -1,
            "rtsp_streaming_over_tcp": false,
            "rtsp_server_reclamation_client_timeout_sec": 10,
            "socket_buffer_size":2000000,
            "stream_monitor_interval_secs": 2,
            "rtp_udp_port_range" : "31000-31200",
            "udp_latency_ms": 200,
            "udp_drop_on_latency": false,
            "webrtc_latency_ms": 20,
            "enable_frame_drop": true,
            "webrtc_max_birate": 10000,
            "webrtc_min_birate": 2000,
            "webrtc_start_birate": 4000,
            "webrtc_peer_conn_timeout_sec": 10,
            "enable_grpc": true,
            "grpc_server_port": "50051",
            "webrtc_in_audio_sender_max_bitrate": 128000,
            "webrtc_in_video_degradation_preference": "resolution",
            "webrtc_in_video_sender_max_framerate": 30,
            "remote_vst_address": "",
            "webrtc_port_range": {"min":0, "max":0},
            "enable_websocket_pingpong": false,
            "websocket_keep_alive_ms": 5000
    },
    "onvif":
    {
            "device_discovery_timeout_secs":10,
            "onvif_request_timeout_secs":20,
            "device_discovery_freq_secs":15,
            "device_discovery_interfaces": [],
            "max_devices_supported": 8,
            "default_bitrate_kbps": 8000,
            "default_framerate": 30,
            "default_resolution": "1920x1080",
            "default_gov_length": 60
    },
    "data":
    {
            "storage_config_file": "/root/vst_release/configs/vst_storage.json",
            "storage_threshold_percentage": 95,
            "storage_monitoring_frequency_secs": 2,
            "enable_avsync_udp_input": true,
            "nv_streamer_directory_path": "/home/vst/vst_release/streamer_videos/",
            "nv_streamer_loop_playback":true,
            "nv_streamer_seekable":false,
            "nv_streamer_max_upload_file_size_MB": 10000,
            "nv_streamer_media_container_supported": ["mp4","mkv"],
            "nv_streamer_metadata_container_supported": ["json"],
            "nv_streamer_rtsp_server_output_buffer_size_kb": 1000,
            "supported_video_codecs": ["h264","h265"],
            "supported_audio_codecs": ["pcmu","pcma","mpeg4-generic"],
            "enable_aging_policy": false,
            "max_video_download_size_MB":1000,
            "always_recording": true,
            "event_recording": true,
            "event_record_length_secs": 10,
            "record_buffer_length_secs": 0,
            "use_software_path": false,
            "webrtc_in_fixed_resolution": "1280x720",
            "webrtc_in_max_framerate": 30,
            "webrtc_in_video_bitrate_thresold_percentage": 50,
            "webrtc_in_passthrough": false,
            "webrtc_sender_quality": "pass_through",
            "enable_rtsp_server_frameid_support": true,
            "gpu_indices": [],
            "webrtc_out_enable_insert_sps_pps" : true,
            "webrtc_out_set_iframe_interval" : 30,
            "webrtc_out_set_idr_interval" : 256,
            "webrtc_out_min_drc_interval" : 5,
            "device_name" : "VST",
            "device_location" : "",
            "enable_dec_low_latency_mode": false
    },
    "notifications":
    {
            "enable_notification": false,
            "use_message_broker": "None",
            "message_broker_topic": "vst.event",
            "message_broker_payload_key": "sensor.id",
            "message_broker_metadata_topic": "test",
            "redis_server_env_var":"localhost:6379",
            "kafka_server_address": "localhost:9092"
    },
    "debug":
    {
            "enable_perf_logging":true,
            "enable_qos_monitoring":true,
            "qos_logfile_path":"/root/vst_release/webroot/log/",
            "qos_data_capture_interval_sec":1,
            "qos_data_publish_interval_sec":5,
            "enable_gst_debug_probes":true,
            "enable_prometheus":false,
            "prometheus_port": "8080",
            "enable_highlighting_logs":false,
            "enable_debug_apis": false,
            "dump_webrtc_input_stats": false,
            "enable_frameid_in_webrtc_stream": false,
            "enable_network_bandwidth_notification" : false
    },
    "overlay":
    {
            "video_metadata_server": "",
            "video_metadata_query_batch_size_num_frames": 300,
            "use_video_metadata_protobuf": false,
            "enable_gem_drawing": false,
            "analytic_server_address": "http://10.24.216.236:30080/emdx"
    },
    "security":
    {
            "use_https": true,
            "use_rtsp_authentication": false,
            "use_http_digest_authentication": false,
            "use_multi_user": false,
            "enable_user_cleanup": false,
            "session_max_age_sec": 2592000,
            "multi_user_extra_options": ["Secure", "SameSite=none"],
            "nv_org_id": "",
            "nv_ngc_key": ""
    }
}

Questions

  1. Is this delay expected under default recording setup?
  2. Can VST record frames with the exact same timing as the live stream feed?
  3. Any recommended config or flags to reduce or eliminate this offset?

Suppose recorded streams have more delay then live streams. Why you care about the delay of recorded streams? Can you share more details of your use case?

Thanks for the response.

To clarify. My use case requires me to visually confirm events in the recorded video at exact timestamps.

The system detects events in real-time and logs them with precise timestamps (e.g., 12:01:15.200). Later, I use the recorded video to review what happened at that exact time — down to the second accuracy. This is critical for things like:

  • Verifying motion detections
  • ALPR Detection
  • Reviewing object/vehicle behavior
  • Matching external sensor data (e.g., GPS) with video

If the recording lags behind live video by an unknown or inconsistent amount (3–5 seconds), it becomes impossible to:

  • Reliably find the exact moment in the recording
  • Confirm the event visually
  • Sync with logs or other sensor data

Even if the delay is expected, I need a way to:

  1. Ensure it’s consistent
  2. Or have the exact offset exposed
  3. Or ideally, have recording be timestamp-aligned with live view

Can the NTP live camera feed timestamps be used to determine the delays of recorded streams or save recordings?

Can you set the delay like below when playback recorded streams?

Where can I find this setting?

Here is the setting:
image