# Unifi

## VAAPI Hardware Decoding

```bash
ffmpeg \
    -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
    -rtsp_transport tcp  \
    -i 'rtsps://192.168.2.1:7441/7IF4VumJ84VoYyP2?enableSrtp' -f matroska -vf 'format=nv12,hwupload' -c:v hevc_vaapi -c:a copy -b:v 100M - | ffplay -i -
```

## Unifi Protect Camera Access with ffplay

Create a .desktop file like so:

```conf
[Desktop Entry]
Name=Unifi Cameras
Exec=ffplay -fflags nobuffer -flags low_delay "rtsps://"
Icon=/home/ducoterra/.icons/unifi_protect.jpg
Type=Application
Actions=doorbell;package;garage;
Keywords=camera,doorbell,package,garage;

[Desktop Action doorbell]
Name=Doorbell
Exec=ffplay -fflags nobuffer -flags low_delay "rtsps://"
Icon=/home/ducoterra/.icons/unifi_protect.jpg

[Desktop Action package]
Name=Package
Exec=ffplay -fflags nobuffer -flags low_delay "rtsps://"
Icon=/home/ducoterra/.icons/unifi_protect.jpg

[Desktop Action garage]
Name=Garage
Exec=ffplay -fflags nobuffer -flags low_delay "rtsps://"
Icon=/home/ducoterra/.icons/unifi_protect.jpg
```