Hi,
Since my previous post, I have downgraded the SDK to 4.2.5, but things aren’t working as they should.
I’m trying to run this simple script to record from a zed x mono stereo pair, which works if I use one IP but not localhost.
import pyzed.sl as sl
import time
# Camera
zed = sl.Camera()
# Init
init = sl.InitParameters()
init.camera_fps = 15
init.depth_mode = sl.DEPTH_MODE.NONE
init.sdk_verbose = 1
#init.set_from_stream("192.168.1.12", 34000) # WORKS!
init.set_from_stream("127.0.0.1", 34000) # DOES NOT WORK
status = zed.open(init)
if status != sl.ERROR_CODE.SUCCESS:
print("Camera Open", status, "Exit program.")
exit(1)
# Recording
recordingParameters = sl.RecordingParameters() # --- IT FAILS WITH 127.0.0.1 with recording parameters
recordingParameters.compression_mode = sl.SVO_COMPRESSION_MODE.H264
recordingParameters.video_filename = "./teste.svo"
status = zed.enable_recording(recordingParameters)
if status != sl.ERROR_CODE.SUCCESS:
print("Camera Open", status, "Exit program.")
exit(1)
# Runtime
runtime = sl.RuntimeParameters()
image = sl.Mat()
i = 0
start = time.perf_counter() # high-resolution timer
while time.perf_counter() - start < 15.0:
if zed.grab(runtime) == sl.ERROR_CODE.SUCCESS:
print("\tsuccess "+ str(i))
i+=1
zed.retrieve_image(image, sl.VIEW.LEFT) # Retrieve the left image
else:
print("\tfailure " + str(i))
# Close the camera
zed.disable_recording()
zed.close()
I ran this script by streaming using ip 192.168.1.12 and 127.0.0.1 (localhost). The first works fine, the second does not. Here’s the logs of both:
192.168.1.12
/bin/python /home/user/Desktop/code_zedx/record.pyuser@GTW-ONX16-ubuntu:~/Desktop/code_zedx$ /bin/python /home/user/Desktop/code_zedx/record.py
[2025-05-14 15:03:01 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:03:01 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:03:01 UTC][ZED][INFO] Logging level INFO
[Streaming] Warning : receiving port 34000 is not available (already used)... switching to port 34002. Retrying...
[Streaming] Metadata timeout. the size is equal to 196 instead of 21960. Skipping.
[Streaming] No backward compatibility required.
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NvMMLiteBlockCreate : Block : BlockType = 279
[2025-05-14 15:03:01 UTC][ZED][INFO] [Init] Depth mode: NONE
[2025-05-14 15:03:01 UTC][ZED][INFO] [Init] Serial Number: S/N 106758411
[2025-05-14 15:03:05 UTC][ZED][WARNING] [Init] Self-calibration failed. Point the camera towards a more textured and brighter area. Avoid objects closer than 1 meter (Error code: 0x01)
success 0
success 1
success 2
success 3
success 4
success 5
success 6
success 7
success 8
success 9
success 10
success 11
...
127.0.0.1 (localhost)
/bin/python /home/user/Desktop/code_zedx/record.py
user@GTW-ONX16-ubuntu:~/Desktop/code_zedx$ /bin/python /home/user/Desktop/code_zedx/record.py
[2025-05-14 15:19:47 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:19:47 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:19:47 UTC][ZED][INFO] Logging level INFO
[ZED][Streaming] Switching to SHM-boost backend input
[Streaming] Warning : receiving port 34000 is not available (already used)... switching to port 34002. Retrying...
[Streaming] No backward compatibility required.
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NvMMLiteBlockCreate : Block : BlockType = 279
[2025-05-14 15:19:47 UTC][ZED][INFO] [Init] Depth mode: NONE
[2025-05-14 15:19:47 UTC][ZED][INFO] [Init] Serial Number: S/N 106758411
[2025-05-14 15:19:50 UTC][ZED][WARNING] [Init] Self-calibration failed. Point the camera towards a more textured and brighter area. Avoid objects closer than 1 meter (Error code: 0x01)
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 77 Level = 50
NvMMLiteNvVideoCreate:3938: NvVideoEncodeCreate failed
NvVideo: 4173: Failed to create Video encoder
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
Segmentation fault (core dumped)
user@GTW-ONX16-ubuntu:~/Desktop/code_zedx$
Here’s the zed_media_server_cli.server logs of that time:
4 15:16:59 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Adding Receiver with IP: 192.168.1.12
May 14 15:17:10 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Removing Receiver with IP: 192.168.1.12
May 14 15:17:13 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Adding Receiver with IP: 127.0.0.1
May 14 15:17:23 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Removing Receiver with IP: 127.0.0.1
May 14 15:18:04 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Adding Receiver with IP: 127.0.0.1
May 14 15:18:14 GTW-ONX16-ubuntu ZED_Media_Server[6600]: [ZED][Streaming] Removing Receiver with IP: 127.0.0.1
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error Timeout: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error Timeout: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error Timeout: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 137)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error Timeout: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: Failed socket read: Connection reset by peer (in src/rpc/socket/common/SocketUtils.cpp, function readSocket(), line 79)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 277)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: Receive worker failure, notifying 3 waiting threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 350)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error InvalidState: Argus client is exiting with 3 outstanding client threads (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 366)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 379)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: Client thread received an error from socket (in src/rpc/socket/client/ClientSocketManager.cpp, function send(), line 145)
May 14 15:19:16 GTW-ONX16-ubuntu ZED_Media_Server[6600]: (Argus) Error FileOperationFailed: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function dispatch(), line 92)
May 14 15:19:25 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: A process of this unit has been killed by the OOM killer.
May 14 15:19:27 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Main process exited, code=killed, status=9/KILL
May 14 15:19:27 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Failed with result 'oom-kill'.
May 14 15:19:27 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Consumed 8min 20.544s CPU time.
May 14 15:19:28 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Scheduled restart job, restart counter is at 1.
May 14 15:19:28 GTW-ONX16-ubuntu systemd[1]: Stopped ZED Media Server.
May 14 15:19:28 GTW-ONX16-ubuntu systemd[1]: zed_media_server_cli.service: Consumed 8min 20.544s CPU time.
May 14 15:19:28 GTW-ONX16-ubuntu systemd[1]: Started ZED Media Server.
May 14 15:19:29 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [ZEDMediaServer] Version 0.1.8
May 14 15:19:29 GTW-ONX16-ubuntu ZED_Media_Server[7171]: ** CLI version **
May 14 15:19:29 GTW-ONX16-ubuntu sudo[7180]: root : PWD=/ ; USER=root ; COMMAND=/usr/bin/systemctl restart nvargus-daemon
May 14 15:19:29 GTW-ONX16-ubuntu sudo[7180]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
May 14 15:19:29 GTW-ONX16-ubuntu sudo[7180]: pam_unix(sudo:session): session closed for user root
May 14 15:19:34 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [ZXCamera] Camera 314383743 opened at resolution 3840 x 2160 and fps 15
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [ZXCamera] Camera 316946451 opened at resolution 3840 x 2160 and fps 15
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [Streaming] Use Transport layer mode : 2
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [Streaming] Use SHM-Boost IPC backend
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: NvMMLiteOpen : Block : BlockType = 8
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: ===== NvVideo: NVENC =====
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: NvMMLiteBlockCreate : Block : BlockType = 8
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: Opening in BLOCKING MODE
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: 892744264
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: 842091865
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: NvVideo: H265 : Profile : 1
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [VirtualCameraStreamer] Creating Streamer for 3840 x 2160 @ 15
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [VirtualCameraStreamer] --> Enter <--
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: NVMEDIA: Need to set EMC bandwidth : 1436000
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: NvVideo: bBlitMode is set to TRUE
May 14 15:19:36 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [Streaming] Streaming is now running....
May 14 15:19:47 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [ZED][Streaming] Adding Receiver with IP: 127.0.0.1
May 14 15:19:57 GTW-ONX16-ubuntu ZED_Media_Server[7171]: [ZED][Streaming] Removing Receiver with IP: 127.0.0.1
If I run this a couple times, ocasionally, instead of segfaulting, I get a slightly different log and it will hang instead of terminating by itself:
user@GTW-ONX16-ubuntu:~/Desktop/code_zedx$ /bin/python /home/user/Desktop/code_zedx/record.py
[2025-05-14 15:23:23 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:23:23 UTC][ZED][INFO] Logging level INFO
[2025-05-14 15:23:23 UTC][ZED][INFO] Logging level INFO
[ZED][Streaming] Switching to SHM-boost backend input
[Streaming] Warning : receiving port 34000 is not available (already used)... switching to port 34002. Retrying...
[Streaming] No backward compatibility required.
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NvMMLiteBlockCreate : Block : BlockType = 279
[2025-05-14 15:23:23 UTC][ZED][INFO] [Init] Depth mode: NONE
[2025-05-14 15:23:23 UTC][ZED][INFO] [Init] Serial Number: S/N 106758411
[2025-05-14 15:23:26 UTC][ZED][WARNING] [Init] Self-calibration failed. Point the camera towards a more textured and brighter area. Avoid objects closer than 1 meter (Error code: 0x01)
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NvVideo: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 77 Level = 50
NvMMLiteNvVideoCreate:3938: NvVideoEncodeCreate failed
NvVideo: 4173: Failed to create Video encoder
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
VENC: NvVideoEncBlockReportError: 2469: BlockSide error 0x4
NvVideoEnc: BlockError
NvVideoEncTransferCaptureBufferToBlock: DoWork failed line# 644
[2025-05-14 15:23:42 UTC][ZED][WARNING] CAMERA NOT INITIALIZED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
failure 0
[ERROR] (/builds/sl/ZEDKit/lib/src/sl_input/mmapi/R364/NvV4l2ElementPlane.cpp:256) <> Capture Plane:Error while Qing buffer: Device or resource busy
[ERROR] (/builds/sl/ZEDKit/lib/src/sl_input/mmapi/R364/NvV4l2ElementPlane.cpp:178) <> Capture Plane:Error while DQing buffer: Invalid argument
I am running L4T=36.4.3 and I also found out that there are problems when I run ZED_Diagnostic. Here’s the logs:
ZED_Diagnostic_Results.json (5.2 KB).
I can’t understand what I am doing wrong. Is the 36.4.3 not supported?