i’m wondering if someone could help me, i’m trying to display and save videos from my flir hadron camera ,i’m using gstreamer in python3 opencv and it succefully displays and saves the IR videos from the BOSON, but i’m losing frames in the RGB videos which leads to slow displaying and fast playback and tried to add various command to the gstreamer piplines such as videorate to control the fps but nothing help .
here is the RGB code for displaying and saving:
cap=cv2.VideoCapture(capset,cv2.CAP_GSTREAMER)
if cap.isOpened() is not True:
print(“Cannot open camera. Exiting.”)
quit()
actual_width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
actual_height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
actual_fps = float(cap.get(cv2.CAP_PROP_FPS));
print(‘Capture opened framing %d x %d @ %f’ % (actual_width,actual_height,actual_fps))
Hey , i’ve change that thank you but i still have the same problem with frame lost while displayin from the camera and we’ve modified the script a little to figure exactly the part that slowing the display and it was the reading from the camera ret,frame = cap.read()
we’ve also noticed that the jetson nano is only using CPU and now i’m trying to install opencv with Cuda and cudnn to be able to use the GPU to process the frames . do you have any idea about if i need to add any lines in my code to force the using of GPU ?
also thank you for response i appreciate it
Hi,
Please run sudo jetson_clocks to enable CPU cores always at maximum clock. This is optimal throughput of CPU cores on Jetson Nano. OpenCV mainly runs on CPU and performance may be capped by CPU capability. If running at maximum clock still cannot achieve target performance, we would suggest use gstreamer or jetson_multiemdia_api to developer your use-case. The two frameworks use hardware DMA buffer and additional memory copy is eliminated to get maximum throughput.
Hey, i really appreciate your help. I’ve tried the sudo jetson_clocks but it didn’t help. it’s an opencv problem because when i execute the same gstreamer pipline in the terminal the display is fluide but in the python3 script i’m losing frame in the read() part i truly have no idea how to solve this problem to stop losing frames. i have to work on opencv because there’s going to be some AI running for the videos idon’t have a choice