frigate: Event/Recording Playback Very Slow to Load on Android Home Assistant App
Describe the problem you are having
When opening either an event or recording on my S20 Android using the Home Assistant app, it normally takes 10 to 20 seconds to load and begin playing the clip.
Clips and recordings open very quickly on my PC using Chrome or my iPad using the iOS Home Assistant app.
Version
0.13.0-49814B3
Frigate config file
database:
path: /config/frigate.db
mqtt:
host: 192.168.1.15
port: 1883
user: username
password: password
detectors:
coral:
type: edgetpu
device: pci:0
birdseye:
enabled: True
# width: 3840
# height: 2160
mode: continuous
quality: 1
#Use hardware acceleration for ffmpeg
ffmpeg:
#hwaccel_args: preset-intel-qsv-h264
hwaccel_args: preset-vaapi
#Other options are preset-intel-qsv-h265
#For AMD cards use preset-vaapi
record:
enabled: true
expire_interval: 10
retain:
days: 5
events:
retain:
default: 10
mode: active_objects
# detect:
# width: 704
# height: 480
# fps: 5
snapshots:
enabled: true
timestamp: true
bounding_box: true
crop: true
height: 500
retain:
default: 3
timestamp_style: #for snapshot
position: tl
format: "%m/%d/%Y %H:%M:%S"
color:
red: 255
green: 255
blue: 255
thickness: 2
effect: shadow
objects:
track:
- person
- car
- bus
- motorcycle
- cat
- dog
- bicycle
go2rtc:
hass:
config: /config
streams:
entry:
- rtsp://admin:password@192.168.3.6:554/cam/realmonitor?channel=1&subtype=0
entry_sub:
- rtsp://admin:password@192.168.3.6:554/cam/realmonitor?channel=1&subtype=1
driveway:
- rtsp://admin:password@192.168.3.7:554/cam/realmonitor?channel=1&subtype=0
driveway_sub:
- rtsp://admin:password@192.168.3.7:554/cam/realmonitor?channel=1&subtype=1
front:
- rtsp://admin:password@192.168.3.8:554/cam/realmonitor?channel=1&subtype=0
front_sub:
- rtsp://admin:password@192.168.3.8:554/cam/realmonitor?channel=1&subtype=1
cameras:
entry:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/entry_sub
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/entry
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-aac
detect:
width: 704
height: 480
fps: 5
motion:
mask:
- 704,450,704,480,445,480,445,450
driveway:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/driveway_sub
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/driveway
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-aac
zones:
driveway_east:
coordinates: 122,217,410,189,346,171,76,188
driveway_north:
coordinates: 171,480,431,480,439,449,648,448,673,395,349,264,261,203,120,214
driveway_west:
coordinates: 539,230,594,249,581,294,545,325,361,264
detect:
width: 1280
height: 720
fps: 5
motion:
mask:
- 704,450,704,480,445,480,445,450
- 704,0,704,118,0,81,0,0
objects:
filters:
person:
mask:
- 423,194,445,192,453,164,422,160
front:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/front_sub
input_args: preset-rtsp-restream
roles:
- detect
- path: rtsp://127.0.0.1:8554/front
input_args: preset-rtsp-restream
roles:
- record
output_args:
record: preset-record-generic-audio-aac
detect:
width: 1280
height: 720
fps: 5
motion:
mask:
- 704,450,704,480,445,480,445,450
Relevant log output
2024-01-06 14:42:54.134369402 [INFO] Preparing Frigate...
2024-01-06 14:42:54.144298686 [INFO] Starting Frigate...
2024-01-06 14:42:55.279697714 [2024-01-06 09:42:55] frigate.app INFO : Starting Frigate (0.13.0-49814b3)
2024-01-06 14:42:55.337605326 [2024-01-06 09:42:55] frigate.app INFO : Creating directory: /tmp/cache
2024-01-06 14:42:55.394046085 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Starting migrations
2024-01-06 14:42:55.416241322 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "001_create_events_table"
2024-01-06 14:42:55.416272149 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "event" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "label" VARCHAR(20) NOT NULL, "camera" VARCHAR(20) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "top_score" REAL NOT NULL, "false_positive" INTEGER NOT NULL, "zones" JSON NOT NULL, "thumbnail" TEXT NOT NULL)',)
2024-01-06 14:42:55.416893031 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "event_label" ON "event" ("label")',)
2024-01-06 14:42:55.417265257 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "event_camera" ON "event" ("camera")',)
2024-01-06 14:42:55.417849181 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 001_create_events_table
2024-01-06 14:42:55.429712877 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "002_add_clip_snapshot"
2024-01-06 14:42:55.429880562 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'has_clip', <BooleanField: Event.has_clip>)
2024-01-06 14:42:55.432177421 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'has_snapshot', <BooleanField: Event.has_snapshot>)
2024-01-06 14:42:55.433523341 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 002_add_clip_snapshot
2024-01-06 14:42:55.445214907 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "003_create_recordings_table"
2024-01-06 14:42:55.445326365 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "recordings" ("id" VARCHAR(30) NOT NULL PRIMARY KEY, "camera" VARCHAR(20) NOT NULL, "path" VARCHAR(255) NOT NULL, "start_time" DATETIME NOT NULL, "end_time" DATETIME NOT NULL, "duration" REAL NOT NULL)',)
2024-01-06 14:42:55.445524801 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_camera" ON "recordings" ("camera")',)
2024-01-06 14:42:55.445734053 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE UNIQUE INDEX IF NOT EXISTS "recordings_path" ON "recordings" ("path")',)
2024-01-06 14:42:55.445996067 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "recordings_start_time_end_time" ON "recordings" (start_time, end_time)',)
2024-01-06 14:42:55.446562649 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 003_create_recordings_table
2024-01-06 14:42:55.455036035 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "004_add_bbox_region_area"
2024-01-06 14:42:55.455132320 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'region', <JSONField: Event.region>)
2024-01-06 14:42:55.456757977 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'box', <JSONField: Event.box>)
2024-01-06 14:42:55.458332465 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'area', <IntegerField: Event.area>)
2024-01-06 14:42:55.459797577 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 004_add_bbox_region_area
2024-01-06 14:42:55.475130385 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "005_make_end_time_nullable"
2024-01-06 14:42:55.475191735 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'end_time')
2024-01-06 14:42:55.476924196 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 005_make_end_time_nullable
2024-01-06 14:42:55.486540789 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "006_add_motion_active_objects"
2024-01-06 14:42:55.486638368 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('recordings', 'objects', <IntegerField: Recordings.objects>)
2024-01-06 14:42:55.487040260 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('recordings', 'motion', <IntegerField: Recordings.motion>)
2024-01-06 14:42:55.487492684 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 006_add_motion_active_objects
2024-01-06 14:42:55.494662746 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "007_add_retain_indefinitely"
2024-01-06 14:42:55.494692956 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'retain_indefinitely', <BooleanField: Event.retain_indefinitely>)
2024-01-06 14:42:55.496876160 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 007_add_retain_indefinitely
2024-01-06 14:42:55.506842083 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "008_add_sub_label"
2024-01-06 14:42:55.506872355 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'sub_label', <CharField: Event.sub_label>)
2024-01-06 14:42:55.507361503 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 008_add_sub_label
2024-01-06 14:42:55.514104111 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "009_add_object_filter_ratio"
2024-01-06 14:42:55.514133062 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'ratio', <FloatField: Event.ratio>)
2024-01-06 14:42:55.516416001 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 009_add_object_filter_ratio
2024-01-06 14:42:55.525789602 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "010_add_plus_image_id"
2024-01-06 14:42:55.525899407 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'plus_id', <CharField: Event.plus_id>)
2024-01-06 14:42:55.526433108 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 010_add_plus_image_id
2024-01-06 14:42:55.533188626 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "011_update_indexes"
2024-01-06 14:42:55.533213526 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "event_start_time_end_time" ON "event" ("start_time" DESC, "end_time" DESC)',)
2024-01-06 14:42:55.533456952 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('DROP INDEX recordings_start_time_end_time',)
2024-01-06 14:42:55.533685275 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_end_time_start_time" ON "recordings" ("end_time" DESC, "start_time" DESC)',)
2024-01-06 14:42:55.534200695 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 011_update_indexes
2024-01-06 14:42:55.541060445 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "012_add_segment_size"
2024-01-06 14:42:55.541086279 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('recordings', 'segment_size', <FloatField: Recordings.segment_size>)
2024-01-06 14:42:55.543608895 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 012_add_segment_size
2024-01-06 14:42:55.555034842 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "013_create_timeline_table"
2024-01-06 14:42:55.555060405 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "timeline" ("timestamp" DATETIME NOT NULL, "camera" VARCHAR(20) NOT NULL, "source" VARCHAR(20) NOT NULL, "source_id" VARCHAR(30), "class_type" VARCHAR(50) NOT NULL, "data" JSON)',)
2024-01-06 14:42:55.555389171 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_camera" ON "timeline" ("camera")',)
2024-01-06 14:42:55.555578539 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_source" ON "timeline" ("source")',)
2024-01-06 14:42:55.555804952 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX IF NOT EXISTS "timeline_source_id" ON "timeline" ("source_id")',)
2024-01-06 14:42:55.556280644 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 013_create_timeline_table
2024-01-06 14:42:55.564643350 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "014_event_updates_for_fp"
2024-01-06 14:42:55.564667763 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'score', <FloatField: Event.score>)
2024-01-06 14:42:55.565056429 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'model_hash', <CharField: Event.model_hash>)
2024-01-06 14:42:55.565283475 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'detector_type', <CharField: Event.detector_type>)
2024-01-06 14:42:55.565589785 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'model_type', <CharField: Event.model_type>)
2024-01-06 14:42:55.565875546 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'area')
2024-01-06 14:42:55.567546507 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'false_positive')
2024-01-06 14:42:55.569047816 [2024-01-06 09:42:55] peewee_migrate.logs INFO : apply_default ('event', 'false_positive', <BooleanField: Event.false_positive>)
2024-01-06 14:42:55.569249683 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 014_event_updates_for_fp
2024-01-06 14:42:55.591310902 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "015_event_refactor"
2024-01-06 14:42:55.591338926 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'top_score')
2024-01-06 14:42:55.593613730 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'score')
2024-01-06 14:42:55.595731307 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'region')
2024-01-06 14:42:55.597788952 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'box')
2024-01-06 14:42:55.599234971 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'area')
2024-01-06 14:42:55.600675235 [2024-01-06 09:42:55] peewee_migrate.logs INFO : drop_not_null ('event', 'ratio')
2024-01-06 14:42:55.602185416 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('event', 'data', <JSONField: Event.data>)
2024-01-06 14:42:55.604026702 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 015_event_refactor
2024-01-06 14:42:55.614250104 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "016_sublabel_increase"
2024-01-06 14:42:55.614276219 [2024-01-06 09:42:55] peewee_migrate.logs INFO : change_column ('event', 'sub_label', <CharField: Event.sub_label>)
2024-01-06 14:42:55.615962076 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 016_sublabel_increase
2024-01-06 14:42:55.625395815 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "017_update_indexes"
2024-01-06 14:42:55.625490411 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_camera_segment_size" ON "recordings" ("camera", "segment_size")',)
2024-01-06 14:42:55.625842579 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 017_update_indexes
2024-01-06 14:42:55.633262534 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "018_add_dbfs"
2024-01-06 14:42:55.633293610 [2024-01-06 09:42:55] peewee_migrate.logs INFO : add_column ('recordings', 'dBFS', <IntegerField: Recordings.dBFS>)
2024-01-06 14:42:55.633880031 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 018_add_dbfs
2024-01-06 14:42:55.643262135 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "019_create_regions_table"
2024-01-06 14:42:55.643375010 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE TABLE IF NOT EXISTS "regions" ("camera" VARCHAR(20) NOT NULL PRIMARY KEY, "last_update" DATETIME NOT NULL, "grid" JSON)',)
2024-01-06 14:42:55.643926174 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 019_create_regions_table
2024-01-06 14:42:55.655007064 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Migrate "020_update_index_recordings"
2024-01-06 14:42:55.655031828 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('DROP INDEX recordings_end_time_start_time',)
2024-01-06 14:42:55.655254722 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_camera_start_time_end_time" ON "recordings" ("camera", "start_time" DESC, "end_time" DESC)',)
2024-01-06 14:42:55.655550870 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_api_recordings_summary" ON "recordings" ("camera", "start_time" DESC, "duration", "motion", "objects")',)
2024-01-06 14:42:55.655700388 [2024-01-06 09:42:55] peewee_migrate.logs INFO : sql ('CREATE INDEX "recordings_start_time" ON "recordings" ("start_time")',)
2024-01-06 14:42:55.656189368 [2024-01-06 09:42:55] peewee_migrate.logs INFO : Done 020_update_index_recordings
2024-01-06 14:42:55.669393865 [2024-01-06 09:42:55] frigate.app INFO : Recording process started: 595
2024-01-06 14:42:55.672303080 [2024-01-06 09:42:55] frigate.app INFO : go2rtc process pid: 89
2024-01-06 14:42:55.695307554 [2024-01-06 09:42:55] detector.coral INFO : Starting detection process: 605
2024-01-06 14:42:55.821252970 [2024-01-06 09:42:55] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as pci:0
2024-01-06 14:42:55.825470167 [2024-01-06 09:42:55] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2024-01-06 14:42:55.825658439 [2024-01-06 09:42:55] frigate.app INFO : Output process started: 607
2024-01-06 14:42:55.825773630 [2024-01-06 09:42:55] frigate.app INFO : Camera processor started for entry: 613
2024-01-06 14:42:55.825838458 [2024-01-06 09:42:55] frigate.app INFO : Camera processor started for driveway: 620
2024-01-06 14:42:55.825883727 [2024-01-06 09:42:55] frigate.app INFO : Camera processor started for front: 622
2024-01-06 14:42:55.825938539 [2024-01-06 09:42:55] frigate.app INFO : Capture process started for entry: 625
2024-01-06 14:42:55.825990374 [2024-01-06 09:42:55] frigate.app INFO : Capture process started for driveway: 635
2024-01-06 14:42:55.826033075 [2024-01-06 09:42:55] frigate.app INFO : Capture process started for front: 639
FFprobe output from your camera
FFPROBE OUTPUT
Stream 0:
Return Code: 0
Video:
Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 1280x720
FPS: 5/1
Audio:
Codec: AAC (Advanced Audio Coding)
Stream 1:
Return Code: 0
Video:
Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 3840x2160
FPS: 89/4
Audio:
Codec: AAC (Advanced Audio Coding)
Frigate stats
No response
Operating system
HassOS
Install method
HassOS Addon
Coral version
M.2
Network connection
Wired
Camera make and model
Amcrest IP8M-T2669EW-AI
Any other information that may be helpful
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
agreed with @gubsy420 this issue should be reopened. it seems to be a general problem with nabu casa does anyone have a fix? or a workaround?
Ok, that solves the problem for when you’re at home but that isn’t going to work outside of your home network. I am having the same issue where clips take forever/won’t load when connected to HA over TLS behind NGINX but they’ll load fine when connected to the local URL. This issue is not fixed, that solution is not the whole solution.
Follow up for anyone who may come across this and wonder what the outcome was…
I never finished configuring my HA companion app to connect to HA via it’s internal IP address when connect to my home Wi-Fi.
It was using the Nabu Casa URL instead so the video traffic was being throttled do the connection type.
After I setup the app to “know” whether it’s home or not via the SSID configuraiton in the app, now the videos play almost instaneously.