ffmpeg

The ffmpeg camera model uses a camera device, a video file, or a stream as a camera.

When used with a streaming camera, the ffmpeg camera model supports any streaming camera format that is supported by the ffmpeg program, including MJPEG, H264, and MP4.

Configuration

{
  "name": "<your-camera-name>",
  "model": "rdk:builtin:ffmpeg",
  "api": "rdk:component:camera",
  "attributes": {
    "intrinsic_parameters": {
      "width_px": <int>,
      "height_px": <int>,
      "fx": <float>,
      "fy": <float>,
      "ppx": <float>,
      "ppy": <float>
    },
    "distortion_parameters": {
      "rk1": <float>,
      "rk2": <float>,
      "rk3": <float>,
      "tp1": <float>,
      "tp2": <float>
    },
    "video_path": "<your-video-path>",
    "input_kw_args": { ... },
    "filters": [
      {
        "name": <string>,
        "args": [ "<first>", "<second>", ... ],
        "kw_args": { ... }
      }
    ],
    "output_kw_args": { ... },
  }
}
{
  "name": "stream-camera",
  "api": "rdk:component:camera",
  "model": "rdk:builtin:ffmpeg",
  "attributes": {
    "video_path": "udp://127.0.0.1:23000",
    "distortion_parameters": {},
    "intrinsic_parameters": {
      "height_px": 2486,
      "width_px": 1970
    }
  }
}

Attributes

NameTypeRequired?Description
video_pathstringRequiredThe file path to the camera device, color image file, or streaming camera. If you are using a camera with an RTSP stream, provide the RTSP address to this attribute.
intrinsic_parametersobjectOptionalThe intrinsic parameters of the camera used to do 2D <-> 3D projections:
  • width_px: The expected width of the aligned image in pixels. Value must be positive.
  • height_px: The expected height of the aligned image in pixels. Value must be positive.
  • fx: The image center x point.
  • fy: The image center y point.
  • ppx: The image focal x.
  • ppy: The image focal y.
distortion_parametersobjectOptionalModified Brown-Conrady parameters used to correct for distortions caused by the shape of the camera lens:
  • rk1: The radial distortion x.
  • rk2: The radial distortion y.
  • rk3: The radial distortion z.
  • tp1: The tangential distortion x.
  • tp2: The tangential distortion y.
input_kw_argsobjectOptionalThe input keyword arguments.
filtersarrayOptionalArray of filter objects that specify:
  • name: The name of the filter.
  • args: The arguments for the filter.
  • kw_args: Any keyword arguments for the filter.
output_kw_argsobjectOptionalThe output keyword arguments.