# 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](https://ffmpeg.org/), including MJPEG, H264, and MP4.

#### Note

The [`ffmpeg` program](https://ffmpeg.org/) must be installed separately from `viam-server` on your system for this driver to work.

## Configuration

- [JSON Template](https://docs.viam.com/reference/components/camera/ffmpeg/#configure-a-ffmpeg-camera-0)
- [JSON Example](https://docs.viam.com/reference/components/camera/ffmpeg/#configure-a-ffmpeg-camera-1)

```json

```
Copy

```json

```
Copy

## Attributes

| Name | Type | Required? | Description |
| --- | --- | --- | --- |
| `video_path` | string | **Required** | The 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_parameters` | object | Optional | The intrinsic parameters of the camera used to do 2D <-> 3D projections:<br>- `width_px`: The expected width of the aligned image in pixels. Value must be positive.<br>- `height_px`: The expected height of the aligned image in pixels. Value must be positive.<br>- `fx`: The image center x point.<br>- `fy`: The image center y point.<br>- `ppx`: The image focal x.<br>- `ppy`: The image focal y. |
| `distortion_parameters` | object | Optional | Modified Brown-Conrady parameters used to correct for distortions caused by the shape of the camera lens:<br>- `rk1`: The radial distortion x.<br>- `rk2`: The radial distortion y.<br>- `rk3`: The radial distortion z.<br>- `tp1`: The tangential distortion x.<br>- `tp2`: The tangential distortion y. |
| `input_kw_args` | object | Optional | The input keyword arguments. |
| `filters` | array | Optional | Array of filter objects that specify:<br>- `name`: The name of the filter.<br>- `args`: The arguments for the filter.<br>- `kw_args`: Any keyword arguments for the filter. |
| `output_kw_args` | object | Optional | The output keyword arguments.
