I would like to know if someone can answer why I cant seem to get a python gstreamer pipline to work without sudo in linux. I have a very small gstreamer pipline and it fails to open the gstreamer if I dont run with sudo infront of python.
I have soon depleted my options, any help would be appriciated. (Using Jetson Orin and ubuntu 20.05)
import sys
import cv2
def read_cam():
G_STREAM_TO_SCREEN = "videotestsrc num-buffers=50 ! videoconvert ! appsink"
cap = cv2.VideoCapture(G_STREAM_TO_SCREEN, cv2.CAP_GSTREAMER)
if cap.isOpened():
cv2.namedWindow("demo", cv2.WINDOW_AUTOSIZE)
while True:
ret_val, img = cap.read()
cv2.imshow('demo',img)
cv2.waitKey(1)
else:
print ("camera open failed")
cv2.destroyAllWindows()
if __name__ == '__main__':
read_cam()
2
Answers
Reinstall your computer and be thorough with your installations….
This is absolutely OK, since vp devices owned by root user.
What you can do is to create new group, add current user to it, change group of vp devices to the new one & grant rw permissions.