start the SVO recording
Now you can use the local streaming to create a receiver and view the camera stream (ZED Explorer or ZED Depth Viewer), you can use GStreamer (see parameters input-stream-ip and input-stream-port), or any other type of stream receiver.
I tried the approach you suggested.
However, I encountered an issue: the SVO file gets corrupted when I run either GStreamer or the local streaming receiver at the same time as the SVO recording.
The corrupted section of the SVO file is shown below:
Hopefully, you can find the area of the corruption. The below area is corrupted.
Below is the code I used to enable both recording and streaming simultaneously.
import pyzed.sl as sl
import time
def main():
zed = sl.Camera()
init_params = sl.InitParameters()
# init_params.camera_resolution = sl.RESOLUTION.HD1080
# init_params.camera_fps = 15
if zed.open(init_params) != sl.ERROR_CODE.SUCCESS:
print("Failed to open ZED camera")
exit(1)
# Start recording to SVO
recording_params = sl.RecordingParameters("output.svo", sl.SVO_COMPRESSION_MODE.H264)
if zed.enable_recording(recording_params) != sl.ERROR_CODE.SUCCESS:
print("Failed to start SVO recording")
zed.close()
exit(1)
# Enable streaming to network (default port 30000)
stream_params = sl.StreamingParameters()
stream_params.codec = sl.STREAMING_CODEC.H264 # or H265
if zed.enable_streaming(stream_params) != sl.ERROR_CODE.SUCCESS:
print("Failed to enable streaming")
zed.disable_recording()
zed.close()
exit(1)
print("Streaming and recording started. Press Ctrl+C to stop.")
start_time = time.time()
try:
while True:
if zed.grab() == sl.ERROR_CODE.SUCCESS:
pass # You can still retrieve frames here if you want
except KeyboardInterrupt:
print("\nStopping...")
zed.disable_streaming()
zed.disable_recording()
zed.close()
if __name__ == "__main__":
main()
and the reciever side, I simply tried the sample zed python code.
cd /usr/local/zed/samples/camera streaming/reciever/python/
python streaming_reciever.py --ip_address 127.0.0.1:30000
This is a typical frame-tearing issue with a USB 3 camera.
It’s caused by a buffer overflow in the USB 3 controller because the CPU is overloaded, and it cannot retrieve the data fast enough.
We are currently using the ZED 2i camera.
Our host PC has sufficient computing resources — a workstation equipped with a 32-core CPU, 128 GB RAM, and external GPUs (RTX 4090).
We are planning to switch to the ZED X MINI along with the ZED Box MINI.
If the issue is due to insufficient computing resources, we expect even more corruption when deploying the recording and streaming tasks on the ZED Box MINI, which has more limited resources.
Is there any way to resolve this issue by adjusting the camera settings?