jetson-inference: OpenGL failed to open X11 server connection

Unfortunately I dont get any video input from my usb camera since OpenGL fails:

grafik

I have tested the my-detection.py script and wanted to forward the camera stream to another computer via RTP. What did I miss?

grafik

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 18 (7 by maintainers)

Most upvoted comments

detectnet.py --model=models/delivery/ssd-mobilenet.onnx --labels=models/delivery/labels.txt --input-blob=input_0 --output-cvg=scores --output-bbox=boxes rtsp://192.168.1.2:7447/wPXqmXadtJmll8FK display://0

@lilhoser try running detectnet.py without display://0, and it should only try to create the X11/XGL window (and if it fails to, should gracefully continue). On the other hand, if you explicitly state display://0, it will not proceed if it can’t create it. It will always try to create the window unless you use the --headless flag.

Fixed… the issue on the original code is that the while is checking for the display.isStreaming… and fails… so let it go into the while loop first then check after with the if not camera.IsStreaming() and no display.IsStreaming().

import jetson.inference
import jetson.utils

net = jetson.inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
camera = jetson.utils.videoSource("/dev/video0")      # '/dev/video0' for V4L2
display = jetson.utils.videoOutput("rtp://10.10.0.186:1234","--headless") # 'my_video.mp4' for file

while True:
    img = camera.Capture()
    detections = net.Detect(img)
    display.Render(img)
    display.SetStatus("Object Detection | Network {:.0f} FPS".format(net.GetNetworkFPS()))
    if not camera.IsStreaming() or not display.IsStreaming():
        break