11

I currently have a raspberry pi model B with a raspberry pi camera connected to it. The raspberry pi is connected to my router via an Ethernet cable, I control the raspberry pi through VNC viewer on my laptop. The issue I have is when controlling the camera through something like python code using camera.start_preview the preview is opened in a preview window which is only viewable if a monitor is connected to the raspberry pi.

Is there a way of sending a live camera preview over my network so that a preview window is opened in my VNC Viewer window on my laptop?

Darth Vader
  • 4,218
  • 24
  • 47
  • 70

2 Answers2

15

See @Andrew Wedgbury 's comment to the accepted answer. " It is now possible to do this over VNC. If you're using the RealVNC server on the Pi, go to VNC options > troubleshooting and enable "experimental direct capture mode", then you'll be able to view the camera preview image over the vnc connection. – Andrew Wedgbury May 31 at 8:53 " This worked and is a great solution as no additional software is required.

thestevenbell
  • 151
  • 1
  • 2
8

The camera preview seems to be handled on a low level in the GPU, and is visible only on a monitor connected directly to the Pi. Any program that shows the camera image in a regular X window should be viewable over VNC.

If you want the video sent over the network, you might consider stream the video instead. Streaming is easy, the only issue is that that the streaming seems to cause a delay of several seconds. Here is a blog post suggesting to stream video as mjpeg, viewable in almost any browser. Here are instructions for streaming using netcat, with some tricks to reduce the latency. This SO post discusses streaming as well.

Frepa
  • 2,261
  • 19
  • 17