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.

  • live output video displays but has a lot of latency and the whole frame just freezes. how could i fix this? what is your internet upload bandwidth? increase it Mar 18, 2020 at 22:34
  • my upload speed is 1.57 Mbps Mar 18, 2020 at 22:54
  • that may be the issue - depending on the resolution and quality settings, live video can easily flood your uplink Mar 18, 2020 at 22:58
  • Is there a way i could display my live video output to a webpage like when i execute the python file instead of the live video output should display as a terminal window it should display on a webpage Mar 18, 2020 at 23:06
  • how you display live video doesn't change the bandwidth requirements Mar 18, 2020 at 23:09

2 Answers 2


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


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.

Video Streaming from raspberry to an external server

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.

  • 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 . Mar 20, 2020 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, 2020 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.