2

I've made a simple pygame application to access my local machine camera as follows :

import pygame,sys
import pygame.camera
from pygame.locals import *

pygame.init()
pygame.camera.init()
stage= pygame.display.set_mode((640,480))
cameras = pygame.camera.list_cameras()

cam=pygame.camera.Camera(cameras[0],(640,480))

cam.start()

while 1:
    image=cam.get_image()
    stage.blit(image,(0,0))
    pygame.display.update()
    for e in pygame.event.get():
        if e.type==pygame.QUIT:
            pygame.quit()
            quit()

I've been looking around for way for me to access my Raspberry Pi camera feed which is located in my Local Network, what I was hopping to be possible is not changing much of my current code and only change the line : cameras = pygame.camera.list_cameras() where it find the RPi camera on the network instead of my local machine by adding the RPi IP and login information, However I'm starting to realize that this maybe not possible the way I want it, but if there is a similar way that doesn't deal with VLC player or any other GUI application would be fine for me because I intend to use as little as possible of the RPi memory and processor, is there a way close to what I'm hopping for?

aero
  • 372
  • 1
  • 4
  • 18
  • To clarify - Do you want to access a camera that is on a different Raspberry Pi within your network or do you want to set up the Raspberry Pi camera to be accessible to other computers? If it's the latter then check out this [article](https://pimylifeup.com/raspberry-pi-webcam-server/) – wyattis May 27 '16 at 04:05
  • I can so what the article talk about by using a web-server, this is however not what i intend to do, I simply want to access the RPi camera from windows using Pygame program as indicated in my question, the camera path for a local linux machine is something like (/dev/video0) i want to do that to a remote linux(Rpi) machine – aero May 27 '16 at 21:41

0 Answers0