|  Developer
Updated on May 6, 2022

Type of events

Edit
Edit
				
					{
    event = "live_rtsp_stream_started"
    streamId = "588b7eb528b12d03be86f36f"
    localRtspUrl = "rtsp://192.168.11.158:5554/5f5796370000003edfb9f23b"
}
				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
localRtspUrl string + the new RTSP URL for video streaming
Edit
Edit
				
					{
    event = "live_rtsp_stream_stopped"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
Edit
				
					{
    event = "live_rtsp_stream_stopped"
    streamId = "588b7eb528b12d03be86f36f"
    errorMessage = "Stream with id "5f5796370000003edfb9f23b1" wasn't created"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
errorMessage string + an error message
Edit
  • The live RTSP link was updated. The event is triggered when IP address of controller was changed.
Edit
				
					{
    event = "live_rtsp_stream_updated"
    streamId = "601937c4122319288da5bc38"
    localRtspUrl = "rtsp://192.168.11.12:5554/601937c4122319288da5bc38"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
localRtspUrl string + The RTSP link of camera live stream in local network
Edit
  • Stream was successfully snapshotted to file and this file was saved to cloud
Edit
				
					{
    event = "stream_snapshotted"
    streamId = "588b7eb528b12d03be86f36f"
    snapshotId = "5f6b511700000063a3cff540"
    cloudStorageKey = { uuid = "1cc217b0-e24e-11ea-acb1-c97f48a744a5", key = "zVZcKrWZDlIZMFK1Dn1vUppOsY8TWEguKR0wXuQUU0CHDmCNSvYChdhArAW8sExcIMmPCuWuSxOM1GV6vJZJ3c36ceArP43mapCNkULrq4xJgllkuw8rZ2D40Uw8myCXK9h7k4Xz2M5g8JNzBR83DamVZCKRZZHeAS5CEHcC3UbcP4WPpkY73jqFCfckP39sE2DDVhlPmqIQnO3YlfeWLWd0hNfrdKvNfMGxAbA6rgW5crFzFePAafQXZV" }
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
snapshotId string + an id of the snapshot
cloudStorageKey table + storage key consist of two parts uuid(string) and key(string)
Edit
  • Stream snapshotting was failed
Edit
				
					{
    event = "stream_snapshot_error"
    streamId = "588b7eb528b12d03be86f36f"
    snapshotId = "5f6b511700000063a3cff540"
    errorMessage = "cloud doesn't respond"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
snapshotId string + an id of the snapshot
errorMessage string + an error message
Edit
				
					{
    event = "audio_stream_started"
    streamId = "588b7eb528b12d03be86f36f"
    user_data = "test"
}				
			
Edit
				
					local params = ...

if params.event == "audio_stream_started" then
    local cameras = require("cameras")
    local info = cameras.get_audio_stream_info( params.streamId )
    ...
end				
			
Edit
Field Type Required Description
event string + Type of an event
streamId string + An id of the stream
user_data any User data which was passed to create_audio_stream
Edit
  • Audio stream is stopped. The event is triggered when camera closes the stream or by delete_audio_stream (if stream was not closed prior to this call). Note that in this case stream is not deleted, you should do it explicitly.
				
					{
    event = "audio_stream_stopped"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
user_data any User data which was passed to create_audio_stream
Edit
				
					local params = ...

if params.event == "audio_stream_stopped" then
    local cameras = require("cameras")
    cameras.delete_audio_stream( params.streamId )
end				
			
Edit
  • Audio stream creation error. The event could be triggered by create_audio_stream or any error occurred during running stream. Note that in case of error stream is not deleted, you should do it explicitly
				
					{
    event = "audio_stream_error"
    streamId = "588b7eb528b12d03be86f36f"
    errorMessage = "..."
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
errorMessage string + an error message
user_data any User data which was passed to create_audio_stream
Edit
				
					local params = ...

if params.event == "audio_stream_error" then
    local cameras = require("cameras")
    cameras.delete_audio_stream( params.streamId )
end				
			
Edit
  • The making of a video particle has failed. The event is triggered by start_stream_saving_to_cloud to notify the plugin that the preview video particle will not be created for the stream recording.
Edit
				
					{
    event = "making_video_particle_failed"
    streamId = "588b7eb528b12d03be86f36f"
    errorMessage = "cloud doesn't respond"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
errorMessage string + an error message
Edit
  • The packets received by a hub from a camera are delivered with delay, but not in live mode. For example, the current time is 2021-12-01 12:00:00, but the stream packets contain frames for 2021-12-01 11:59:40, which means that the accumulated delay is 20 seconds.
  • This happens when the network’s bandwidth is not big enough to transfer the traffic generated by the camera. In this case, the camera creates more packets than can be transferred over the network. All generated packets are placed into a queue, i.e. newly created packets will be sent not instantly, but only after the previous ones. So after some time, the queue will be gigantic and the newly created packets will be placed into the queue for a long time. The delay between creation and receiving of a packet is called accumulated delay.
  • Hub sends this event and immediately restarts the reading of the camera stream, it is needed to remove the delay. The event is emitted when the accumulated delay is bigger than 5 seconds.
  • Such event might be emitted at any time after calling a add_camera_stream.
Edit
				
					{
    event = "camera_accumulated_delay"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The delay between the two consecutive packets is bigger than the threshold. The default threshold is 1 second.
  • This event indicates that there are some issues either with the network or with the camera.
  • Such an event might be emitted at any time after calling a add_camera_stream.
Edit
				
					{
    event = "camera_packet_delay"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The hub cannot establish a connection with a camera, i.e. camera’s stream is unreachable, or there is a FFMPEG operation error on reading the input stream from a camera.
  • Such an event might be emitted at any time after calling a add_camera_stream.
Edit
				
					{
    event = "camera_unreachable"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The reading of the camera stream was closed for an unknown reason.
  • The hub will try to restart reading the camera stream automatically along with emitting this event.
Edit
				
					{
    event = "camera_stream_closed"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The SSH tunnel for remote camera streaming was rejected by Cloud. This means that the user is not able to connect to the stream remotely.
  • Since the cloud tunnels are created along with the start of the RTSP server on the hub, such an event might be emitted at any time after calling a create_live_rtsp_stream.
Edit
				
					{
    event = "cloud_tunnel_rejected"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The SSH tunnel to Cloud for remote camera streaming was established. This event indicates that the user is able to connect to the remote camera stream.
  • Since the cloud tunnels are created along with the start of the RTSP server on the hub, such an event might be emitted at any time after calling a create_live_rtsp_stream.
Edit
				
					{
    event = "cloud_tunnel_established"
    streamId = "588b7eb528b12d03be86f36f"
}				
			
Edit
Field Type Required Description
event string + type of an event
streamId string + an id of the stream
Edit
  • The hub has been connected to a local network via WI-FI or the Ethernet cable was plugged into the hub. Connection to a local network indicates that now the hub may connect to a camera.
Edit
				
					{
    event = "hub_connected_to_local_network"
}				
			
Edit
Field Type Required Description
event string + type of an event
Edit
  • The hub has been disconnected from a local network, i.e. the hub doesn’t have either WI-FI or Ethernet connection.
  • This event shows that the hub is not able to connect to any camera until it will be re-connected to a local network again. When hub will be re-connected to a local network, hub_connected_to_local_network will be emitted.
  • If the hub is not connected to a local network when the plugin subscribes for Camera events using subscribe, this event will be immediately emitted to the plugin.
Edit
				
					{
    event = "hub_disconnected_from_local_network"
}				
			
Edit
Field Type Required Description
event string + type of an event