Create extra views (sky-only, cropped, perspective-corrected, etc.) from one physical camera. Handy, but very resource intensive.
go2rtc:
streams:
# Physical camera
balcony:
- rtsp://user:pass@camera_ip/stream1
# Virtual camera with filters
balcony_sky:
- ffmpeg:rtsp://user:pass@camera_ip/stream1#video=h264#raw=-vf \
perspective=x0=80:y0=400:x1=1342:y1=104:x2=360:y2=1340:x3=1554:y3=1330,scale=1280:720#hardwarecameras:
balcony_sky:
ffmpeg:
output_args:
record: preset-record-generic-audio-aac
inputs:
- path: rtsp://127.0.0.1:8554/balcony_sky
roles: [record, detect]
detect:
width: 848
height: 480
fps: 5
snapshots:
enabled: true
timestamp: true
bounding_box: true
quality: 95
record:
enabled: true
retain:
days: 30
mode: motion
motion:
mask: [coords]
threshold: 30
contour_area: 10
improve_contrast: true
zones:
Park:
coordinates: [coords]
loitering_time: 0
objects: person
objects:
mask: [coords]| Filter | Purpose |
|---|---|
perspective=… |
Rectifies angled shots |
scale=1280:720 |
Down-scales to ease downstream load |
#hardware |
Uses GPU/ASIC if available |
- 30-second CPU sample, virtual cam off
- 30-second CPU sample, virtual cam on
docker stats --no-streamevery second- Average the samples, extrapolate to 24 h
| Item | Value |
|---|---|
| Host kernel | Linux 6.8.12-13-pve |
| Frigate | 0.15.0-beta2 |
| Camera feed | 1080 p RTSP (persp. + scale) |
| State | Avg CPU % | CPU-s / day | Samples |
|---|---|---|---|
| Virtual cam OFF | 84.7 | 73 147 | 30 |
| Virtual cam ON | 266.2 | 230 016 | 30 |
| Delta | +181.6 % | +156 869 | 30 |
- Roughly 3× CPU for one virtual cam.
- Adds ~44 CPU-hours per day.
- Filters (perspective + scale) are the main culprits.
- Expect similar overhead for each extra virtual camera.
- Hardware acceleration is available.
- A corrected or specialty view is important.
- Different areas need different detection settings.
- The host is already CPU-bound or has thermal issues.
- A simple crop via zones is enough.
zones:
Sky_Area:
coordinates: [coords]
objects: []
Ground_Area:
coordinates: [coords]
objects: [person, car]Virtual cameras work reliably, but are extremely resource intensive. In my case, the cost of using the feature for over 6 months has exceeded the cost of a second camera.
Tested on Frigate 0.15.0-beta2. Results will vary with different filters, hardware, and acceleration support.