v1

latestOpenAPI 3.1.0raw.githubusercontent.com2026-02-1354131442.5 KB
v1
camera

Get Camera Status

Get current USB camera connection status using v4l2 detection.

This endpoint provides real-time camera availability and operational status including connection detection via v4l2 interface, initialization status for camera readiness, device information with hardware details and capabilities, and streaming state with active format information.

Detection Process

The system performs an active stream check to return current status if camera already streaming, followed by v4l2 device scan to detect available video devices, camera initialization to attempt camera setup, and capability query to retrieve supported formats and optimal settings.

Usage Recommendations

Check camera status before attempting to start streaming for pre-stream validation, poll periodically to detect camera disconnections for connection monitoring, and use best_format information for format optimization to achieve optimal streaming quality.

get/api/v1/camera/status

Response

Camera status retrieved successfully

connectedboolean required

Whether any camera is connected

messagestring required

Status message

readyboolean required

Whether camera is ready for use

video_devicesstring[] nullable

List of available video device paths

device_namestring nullable

Primary camera device name

bus_infostring nullable

USB bus information

driver_namestring nullable

Camera driver name

total_camerasinteger nullable

Total number of cameras detected

streamingboolean nullable

Whether camera is currently streaming

errorstring nullable

Error message if camera failed to initialize

Example response

{
  "best_format": {
    "format": "MJPG",
    "fps": 30,
    "height": 720,
    "width": 1280
  },
  "bus_info": "usb-xhci-hcd.1-2",
  "connected": true,
  "device_name": "Integrated_Webcam_HD: Integrate",
  "driver_name": "uvcvideo",
  "message": "Camera detected and ready",
  "ready": true,
  "total_cameras": 1,
  "video_devices": [
    "/dev/video0"
  ]
}