pyobs-v4l

This is a pyobs (documentation) module for USB webcams and other Video4Linux cameras.

Example configuration

This is an example configuration:

class: pyobs_v4l.v4lCamera
device: 0

# file naming
filenames: /webcam/pyobs-{DAY-OBS|date:}-{FRAMENUM|string:04d}.fits
video_path: /webcam/video.mjpg

# location
timezone: utc
location:
  longitude: 9.944333
  latitude: 51.560583
  elevation: 201.

# communication
comm:
  jid: test@example.com
  password: ***

# virtual file system
vfs:
  class: pyobs.vfs.VirtualFileSystem
  roots:
    webcam:
      class: pyobs.vfs.HttpFile
      upload: http://localhost:37075/

Available classes

There is one single class for Video4Linux cameras.

v4lCamera

class v4lCamera(device: int = 0, **kwargs: Any)[source]

Bases: BaseVideo

Creates a new BaseWebcam.

On the receiving end, a VFS root with a HTTPFile must exist with the same name as in image_path and video_path, i.e. “webcam” in the default settings.

Parameters:
  • http_port – HTTP port for webserver.

  • exposure_time – Initial exposure time.

  • interval – Min interval for grabbing images.

  • video_path – VFS path to video.

  • filename – Filename pattern for FITS images.

  • fits_namespaces – List of namespaces for FITS headers that this camera should request.

  • fits_headers – Additional FITS headers.

  • centre – (x, y) tuple of camera centre.

  • rotation – Rotation east of north.

  • cache_size – Size of cache for previous images.

  • live_view – If True, live view is served via web server.

  • flip – Whether to flip around Y axis.

  • sleep_time – Time in s with inactivity after which the camera should go to sleep.