Solving Problem opencv 4.x.x video stream failed


I hope this can help

Change

videocapture = cv2.VideoCapture(0 )

to

videocapture = cv2.VideoCapture(0 , cv2.CAP_V4L )

Enabling Remote VNC in Jetson Nano


Fresh install Jetson Nano

sudo ln -s ../vino-server.service \
    /usr/lib/systemd/user/graphical-session.target.wants

gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false

nmcli connection show

copy the UUID active connection
dconf write /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections "['PASTE HERE YOUR UUID']"

sudo vi /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml

PASTE THIS INSIDE SCHEMA
<key name='enabled' type='b'>
     <summary>Enable remote access to the desktop</summary>
      <description>
       If true, allows remote access to the desktop via the RFB
       protocol. Users on remote machines may then connect to the
       desktop using a VNC viewer.
      </description>
     <default>false</default>
    </key>
sudo glib-compile-schemas /usr/share/glib-2.0/schemas

export DISPLAY=:1 //OR USE 0

/usr/lib/vino/vino-server

IF success you can use remmina or realvnc client to connect to Jetson Nano



Making systemd service

sudo vim /etc/systemd/system/vinostartup.service

[Unit]
Description = description about the service
After = network.target
[Service]
ExecStart = /usr/lib/vino/vino-server
[Install]
WantedBy = multi-user.target

 

sudo systemctl enable vinostartup.service

 

Done

Happy Coding

Salam Ngoprek