1

I have just completed my project on an object tracking robot using raspberry pi and I want to be able to view my live video output remotely but I cant seem to find a way how to do it.

What I currently do:
I installed remote.it on my raspberry pi which enables me to connect my Macbook laptop to the raspberry pi via VNC viewer. The raspberry pi is powered by a power bank and I am able to connect my Macbook laptop to the raspberry pi using remote.it. But once I am connected to my raspberry pi using my laptop I then execute the python file for object tracking robot and the live output video displays but has a lot of latency and the whole frame just freezes.

How could I fix this?

What I expect to do:
I want to be able to connect to the raspberry pi through my laptop remotely when it is powered by a power bank via VNC viewer or any means possible so when I execute my python code I should see the live video output without any latency so I can show that my object has been detected.

I was still thinking if it was possible to use remote.it to connect to the raspberry pi then when I execute the python code the live video output without latency should be displayed to a webpage.

I will appreciate it if anyone could help me with solutions on how I could remotely access my raspberry and execute the python code and display a live video output without latency and even how I could display a live video output to a webpage.

M. Rostami
  • 4,323
  • 1
  • 17
  • 36
user3880651
  • 189
  • 2
  • 3
  • 9

2 Answers2

1

I am using X11 forwarding on the raspberry and putty on windows. This way you can see the display of the raspberry on your laptop. I haven't had issues with it. To set it up you need to enable ssh in raspi-config. Then edit sudo nano /etc/ssh/sshd_config and uncomment the line X11Forwarding yes

install xming and putty on your laptop and set up putty under the ssh options to enable x11 forwarding and put in localhost:0

If you connect to the IP of the raspberry in putty you should see the console or if you start a program you see the program window

FR_MPI
  • 71
  • 5
1

I answered your question according to "what you expect to do".


Honestly, it's not a good idea to show the camera stream over a remote desktop tool like VNC. You should improve your code to stream the camera over the HTTP protocol to create an RTC connection. You could do it with the help of OpenCV on python.

Although, I suggest you install the motion package on your raspberry pi. It gives you what exactly you want and of course without any coding.

installation:
Video Streaming from raspberry to an external server

Configuration:
/etc/motion/motion.conf)
You can configure stream quality according your bandwidth limitations.

Make it more secure:
Motion security
If you are concerned about the security of the streams, you can make it much more secure with some configuration and insight.

M. Rostami
  • 4,323
  • 1
  • 17
  • 36
  • Thank you so much for the suggestion i would like to try this out but i dont know how i could implement the motion package into my code like when i execute my code i use these lines of code:
    (cv2.imshow("result", frame1) , cv2.imshow("frame", img_contours)) to show the live video output of the detected object. so how can i implement the motion package in my code instead of using the lines of code above .
    – user3880651 Mar 20 '20 at 11:44
  • @user3880651 My pleasure. You should search for that and ask some questions on other SE sites or SO. – M. Rostami Mar 20 '20 at 13:03