Closed esmoyer closed 2 years ago
You definitely need vaapi
otherwise I don't think it will use hwaccel, in any case that isn't the args that are recommended in the docs. Probably put that back in and paste the logs here.
also what CPU do you have again?
Thanks for the quick response. Yeah I had been trying different things suggested from previous issues. I'll uncomment the vaapi and post logs. I have an Intel Gen6 i5.
Okay cool, please also include your docker compose file
Enabled vaapi
here are the logs:
[2022-09-09 10:32:36] frigate.app INFO : Starting Frigate (0.11.0-c461c9e)
Starting migrations
[2022-09-09 10:32:36] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-09-09 10:32:36] peewee_migrate INFO : There is nothing to migrate
[2022-09-09 10:32:36] detector.coral INFO : Starting detection process: 217
[2022-09-09 10:32:36] frigate.app INFO : Output process started: 219
[2022-09-09 10:32:36] ws4py INFO : Using epoll
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Driveway: 225
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Doorbell: 228
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Sidedrive: 229
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Sideyard: 231
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Backyard: 233
[2022-09-09 10:32:36] frigate.app INFO : Camera processor started for Garage: 235
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Driveway: 236
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Doorbell: 237
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Sidedrive: 239
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Sideyard: 242
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Backyard: 247
[2022-09-09 10:32:36] frigate.app INFO : Capture process started for Garage: 251
[2022-09-09 10:32:37] ws4py INFO : Using epoll
[2022-09-09 10:32:36] frigate.edgetpu INFO : Attempting to load TPU as usb
[2022-09-09 10:32:39] frigate.edgetpu INFO : TPU found
[2022-09-09 10:58:46] ws4py INFO : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:53912]
[2022-09-09 11:00:22] ws4py INFO : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:53912]
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-09-09 11:00:27] frigate.app INFO : Starting Frigate (0.11.0-c461c9e)
Starting migrations
[2022-09-09 11:00:27] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-09-09 11:00:27] peewee_migrate INFO : There is nothing to migrate
[2022-09-09 11:00:28] frigate.app INFO : Output process started: 218
[2022-09-09 11:00:28] ws4py INFO : Using epoll
[2022-09-09 11:00:28] detector.coral INFO : Starting detection process: 216
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Driveway: 221
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:28] frigate.edgetpu INFO : Attempting to load TPU as usb
[2022-09-09 11:00:31] frigate.edgetpu INFO : TPU found
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Doorbell: 225
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Sidedrive: 229
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Backyard: ffmpeg process is not running. exiting capture thread...
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Sideyard: 231
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Backyard: 232
[2022-09-09 11:00:31] frigate.video ERROR : Driveway: ffmpeg process is not running. exiting capture thread...
[2022-09-09 11:00:28] frigate.app INFO : Camera processor started for Garage: 234
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Driveway: 235
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Doorbell: 239
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Sidedrive: 242
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Sideyard: 245
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Backyard: 252
[2022-09-09 11:00:28] frigate.app INFO : Capture process started for Garage: 256
[2022-09-09 11:00:29] ws4py INFO : Using epoll
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:31] frigate.video ERROR : Doorbell: ffmpeg process is not running. exiting capture thread...
[2022-09-09 11:00:34] frigate.record ERROR : Error occurred when attempting to maintain recording cache
[2022-09-09 11:00:34] frigate.record ERROR : could not convert string to float: ''
[2022-09-09 11:00:39] frigate.video ERROR : Sideyard: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Sideyard: ffmpeg process is not running. exiting capture thread...
[2022-09-09 11:00:39] frigate.record ERROR : Error occurred when attempting to maintain recording cache
[2022-09-09 11:00:39] frigate.record ERROR : could not convert string to float: ''
[2022-09-09 11:00:39] frigate.video ERROR : Garage: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Garage: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Garage: ffmpeg process is not running. exiting capture thread...
[2022-09-09 11:00:39] frigate.video ERROR : Sidedrive: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Sidedrive: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Sidedrive: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Sidedrive: Unable to read frames from ffmpeg process.
[2022-09-09 11:00:39] frigate.video ERROR : Sidedrive: ffmpeg process is not running. exiting capture thread...
Docker Compose
version: "3.9"
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: blakeblackshear/frigate:0.11.0-rc2
shm_size: "256mb" # update for your cameras based on calculation above
devices:
- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
- /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /mnt/camstorage/frigate/config:/config:ro
- /mnt/camstorage/frigate/recordings:/media/frigate/recordings
- /mnt/camstorage/frigate/clips:/media/frigate/clips
- /mnt/camstorage/frigate/db:/media/frigate/db
- /dev/bus/usb:/dev/bus/usb
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "1935:1935" # RTMP feeds
environment:
FRIGATE_RTSP_PASSWORD: "X"
TZ: "American/Chicago"
LIBVA_DRIVER_NAME: "i965"
Hmm, that is very odd. If you run vainfo
in the container what do you see?
root@ee023d7e2238:/opt/frigate# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.10.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 2.4.1
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264ConstrainedBaseline: VAEntrypointFEI
VAProfileH264ConstrainedBaseline: VAEntrypointStats
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointStats
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointStats
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
root@ee023d7e2238:/opt/frigate#
That's very weird then that VAAPI isn't happy for some reason. What happens if you try
ffmpeg:
hwaccel_args: -c:v h264_qsv
Also with your setup you posted at the beginning, did you verify that the intel gpu was actually being utilized?
That's very weird then that VAAPI isn't happy for some reason. What happens if you try
ffmpeg: hwaccel_args: -c:v h264_qsv
No errors using this! Not sure about the artifacting yet as I'll have to watch it a bit. That is so weird; so can you ELI5? I'm clueless when it comes to video stuff.
[2022-09-09 16:21:48] frigate.app INFO : Starting Frigate (0.11.0-c461c9e)
Starting migrations
[2022-09-09 16:21:48] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-09-09 16:21:48] peewee_migrate INFO : There is nothing to migrate
[2022-09-09 16:21:49] detector.coral INFO : Starting detection process: 216
[2022-09-09 16:21:49] frigate.app INFO : Output process started: 218
[2022-09-09 16:21:49] ws4py INFO : Using epoll
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Driveway: 224
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Doorbell: 227
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Sidedrive: 229
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Sideyard: 231
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Backyard: 232
[2022-09-09 16:21:49] frigate.app INFO : Camera processor started for Garage: 233
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Driveway: 235
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Doorbell: 236
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Sidedrive: 240
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Sideyard: 244
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Backyard: 247
[2022-09-09 16:21:49] frigate.app INFO : Capture process started for Garage: 251
[2022-09-09 16:21:49] ws4py INFO : Using epoll
[2022-09-09 16:21:50] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:34948]
[2022-09-09 16:21:49] frigate.edgetpu INFO : Attempting to load TPU as usb
[2022-09-09 16:21:51] frigate.edgetpu INFO : TPU found
[2022-09-09 16:22:00] ws4py INFO : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:34948]
[2022-09-09 16:22:00] ws4py INFO : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58262]
Also with your hwaccel
recommendation, this is my intel_gpu_top
; if that helps with anything
No errors using this! Not sure about the artifacting yet as I'll have to watch it a bit. That is so weird; so can you ELI5? I'm clueless when it comes to video stuff.
VAAPI is the standard linux GPU api. QSV (quick sync video) is an intel specific standard that is built on top of VAAPI. The reason for No frames
you were getting with vaapi is unknown, could be any number of things including a bug in the driver on the host or some other issue. Plenty of other users have used it without issue though so it does seem to be something system specific (presumably also including the way this ffmpeg build we are using now is built / includes drivers).
Also with your
hwaccel
recommendation, this is myintel_gpu_top
; if that helps with anything
In any case, this shows that it is being utilized which is what we want to see. Hopefully the smearing issue you saw are gone as well.
Awesome, really appreciate the help. I can usually fumble my way through things to fix or get it working but this had me stumped.
I'm currently on an Intel J5005 (Ubuntu 22.04 server minimized install) and I've noticed that when I use:
ffmpeg:
hwaccel_args:
- -hwaccel
- vaapi
- -hwaccel_device
- /dev/dri/renderD128
- -hwaccel_output_format
- yuv420p
I get artifacts similar to that of the screenshot in the original post but not as bad. However, when looking at intel_gpu_top
, both Reder/3D and Video engines are utilized with Render/3D hitting about 7-9% while Video stays below 4%.
When switching to:
ffmpeg:
hwaccel_args:
- -c:v
- h264_qsv
intel_gpu_top
shows 9-10% usage on the Video engine but the artifacts are worst and exactly as the first photo posted.
I've also noticed that vainfo
is not available in the 0.11.1 container.
I'm currently on an Intel J5005 (Ubuntu 22.04 server minimized install) and I've noticed that when I use:
ffmpeg: hwaccel_args: - -hwaccel - vaapi - -hwaccel_device - /dev/dri/renderD128 - -hwaccel_output_format - yuv420p
I get artifacts similar to that of the screenshot in the original post but not as bad. However, when looking at
intel_gpu_top
, both Reder/3D and Video engines are utilized with Render/3D hitting about 7-9% while Video stays below 4%.When switching to:
ffmpeg: hwaccel_args: - -c:v - h264_qsv
intel_gpu_top
shows 9-10% usage on the Video engine but the artifacts are worst and exactly as the first photo posted.
What cameras do you have? Are you using the recommended stream type/ args?
I've also noticed that
vainfo
is not available in the 0.11.1 container.
You can simply use apt-get to install vainfo in the container.
What cameras do you have? Are you using the recommended stream type/ args?
I am currently using the Wyze Cam V3 with the wz_mini_hacks running on top of the camera. I think I see what's causing the issue for me. I've just split the inputs to use low res (640x360) for detection while high res (1920x1080) for recording. When I view the live feed there are no artifacts anymore but the recording still has the artifacts. So it looks like resolution (along with other settings) might be the culprit?
Using the low res stream for detection has also decreased GPU usage significantly. Intel_gpu_top shows only 1-2% utilization on the video engine.
I believe that I am using the recommended stream type and arguments. But here's my config in case I missed something:
mqtt:
host: 192.168.x.x
port: 1883
topic_prefix: frigate
client_id: frigate
stats_interval: 60
detectors:
coral:
type: edgetpu
device: pci
database:
path: /media/frigate/frigate.db
model:
path: /config/models/spaghettinet/spaghettinet_edgetpu_l_compiled.tflite
width: 320
height: 320
logger:
default: info
logs:
frigate.event: debug
birdseye:
enabled: True
width: 1280
height: 720
quality: 8
mode: objects
ffmpeg:
global_args: -hide_banner -loglevel warning
hwaccel_args:
- -c:v
- h264_qsv
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1
output_args:
detect: -f rawvideo -pix_fmt yuv420p
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
rtmp: -c copy -f flv
detect:
width: 640
height: 360
fps: 5
enabled: True
max_disappeared: 50
stationary:
interval: 10
threshold: 100
objects:
track:
- person
- dog
- cat
- mouse
filters:
person:
min_area: 4000
max_area: 24000000
min_score: 0.5
threshold: 0.7
cat:
min_score: 0.5
threshold: 0.8
dog:
min_score: 0.5
threshold: 0.8
motion:
threshold: 25
contour_area: 99
delta_alpha: 0.2
frame_alpha: 0.2
frame_height: 180
improve_contrast: False
mqtt_off_delay: 30
record:
enabled: True
expire_interval: 60
retain:
days: 152
mode: all
events:
pre_capture: 5
post_capture: 5
objects:
- person
- dog
- cat
- mouse
required_zones: []
retain:
default: 152
mode: motion
objects:
person: 152
dog: 152
cat: 152
mouse: 152
snapshots:
enabled: True
clean_copy: True
timestamp: False
bounding_box: False
crop: False
height: 175
required_zones: []
retain:
default: 152
objects:
person: 152
dog: 152
cat: 152
mouse: 152
rtmp:
enabled: True
live:
height: 720
quality: 8
timestamp_style:
position: "tl"
format: "%m/%d/%Y %H:%M:%S"
color:
red: 255
green: 255
blue: 255
thickness: 2
cameras:
3411_porch:
zones:
front_yard:
coordinates: 0,360,0,196,21,180,168,162,304,152,315,145,398,144,422,144,502,142,640,139,640,360
objects:
- person
- dog
- cat
- mouse
doorsteps:
coordinates: 72,360,330,299,475,265,490,211,640,164,640,360
objects:
- person
record:
events:
required_zones:
- front_yard
- doorsteps
snapshots:
required_zones:
- front_yard
- doorsteps
ffmpeg:
inputs:
- path: rtsp://x:x@192.168.x.x:8554/video1_unicast
roles:
- record
- path: rtsp://x:x@192.168.x.x:8554/video2_unicast
roles:
- detect
- rtmp
best_image_timeout: 60
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
required_zones: []
ui:
order: 0
dashboard: True
I want to follow up on this artifact issue. At least for me it has gone away after switching to using the Docker Wyze Bridge container to expose the RTSP rather than using the Wyze Mini Hacks that run on top of the camera's firmware. Most likely, the issue, at least for me, was caused by the custom firmware addon. It could be a number of things like the patched camera process or CPU utilization issues leading to stream errors.
Describe the problem you are having
Since moving to RC2, my cameras will randomly "artifact" from time to time. I think I followed all the changes needed with the change from RC1 to RC2 (RC1 had zero issues). No settings have been changed for Frigate or the cameras (except variable changes needed by RC2). I did notice I previously had 'vaapi' uncommented, but with RC2 my system didn't like it and would causes errors, so not sure if that is part of it.
Version
0.11.0-c461c9e (RC2)
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
Operating system
Debian
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
IP5M-T1179EW
Any other information that may be helpful
No response