frigate
frigate copied to clipboard
[Config Support]: Enable HEVC/H.265 on Friagte
Describe the problem you are having
I am using frigate in Home Assistant installed on a Raspberry PI4B and try to configure a Reolink RLC810A for detecting in 4K(Main Stream). I noticed H.265 works without Hardware Acceleration but with very high CPU usage and very laggy. I added the following flags to hwaccel_args and I get a green screen.
Is there a way to encode H265 with hwaccel_args on PI4?
Version
0.10.1-83481AF
Frigate config file
mqtt:
host: -
user: -
password: -
cameras:
cam1:
ffmpeg:
inputs:
- path: rtsp://admin:@ipaddress:554//h265Preview_01_main
roles:
- detect
hwaccel_args:
- -c:v
- h264_v4l2m2m
rtmp:
enabled: False
detect:
fps: 3
width: 3840
height: 2160
snapshots:
enabled: True
Relevant log output
[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-07-30 12:36:25] frigate.app INFO : Starting Frigate (0.10.1-83481af)
[2022-07-30 12:36:25] frigate.app INFO : Creating directory: /tmp/cache
Starting migrations
[2022-07-30 12:36:25] peewee_migrate INFO : Starting migrations
There is nothing to migrate
[2022-07-30 12:36:25] peewee_migrate INFO : There is nothing to migrate
[2022-07-30 12:36:25] frigate.app INFO : Output process started: 218
[2022-07-30 12:36:25] detector.cpu INFO : Starting detection process: 217
[2022-07-30 12:36:25] frigate.app INFO : Camera processor started for cam1: 221
[2022-07-30 12:36:25] frigate.edgetpu WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
[2022-07-30 12:36:25] frigate.app INFO : Capture process started for cam1: 222
[2022-07-30 12:36:25] ws4py INFO : Using epoll
[2022-07-30 12:36:25] ws4py INFO : Using epoll
Frigate stats
No response
Operating system
HassOS
Install method
HassOS Addon
Coral version
CPU (no coral)
Any other information that may be helpful
The hardware acceleration flags work with H264 substream but I need to work it with H265 Main Stream
The hardware acceleration flag is h264_v4l2m2m
so naturally it will only work with h264. Did you try hevc_v4l2m2m
?
Thank you. I tried it with hevc_v4l2m2m
but unfortunately it had no effect, still showing a green screen. Debug Camera FPS is also at 0.
You can run ffmpeg -decoders
inside the frigate container to see what decoders are supported
Yes the command gave me a bunch of codecs but from my research the only suitable codec for my PI4 is actually hevc_v4l2m2m
. But I can't explain why it is not working.
Maybe try frigate 0.11 RC it has a new ffmpeg build that could work better
I don't believe the Pi has hwaccel for h265
I don't believe the Pi has hwaccel for h265
Oh yeah, looks like it is an open issue in the jellyfin repo https://github.com/jellyfin/jellyfin-ffmpeg/issues/129
workaround to use h264-streams from RLC810A:
- upgrade Fw to last from here
- change encode resolution for "clear"-stream to 2560*1440
- enable RMTP under Network-Settings/Port-Settings
- you can use following h264 RMTP-streams now: clean (2560x1440): rtmp://{IP}/bcs/channel0_main.bcs?channel=0&stream=0&user=admin&password={password} balanced (896x512): rtmp://{IP}/bcs/channel0_ext.bcs?channel=0&stream=2&user=admin&password={password} fluent (640x360): rtmp://{IP}/bcs/channel0_sub.bcs?channel=0&stream=1&user=admin&password={password}
I don't believe the Pi has hwaccel for h265
It does... https://datasheets.raspberrypi.com/rpi4/raspberry-pi-4-datasheet.pdf
H.265 (HEVC) hardware decode (up to 4Kp60)
H.264 hardware decode (up to 1080p60)
I don't believe the Pi has hwaccel for h265
It does... https://datasheets.raspberrypi.com/rpi4/raspberry-pi-4-datasheet.pdf
H.265 (HEVC) hardware decode (up to 4Kp60) H.264 hardware decode (up to 1080p60)
It supports h265 but ffmpeg does not currently support it
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.