Closed ristoavila closed 1 year ago
for test purposes I've upgraded go2rtc to 1.8.3
more logs are needed, please let frigate run for 1 minute then provide logs
frigate was running 24hours and this happened in the morning at 06:56 at 14:00 same day there were no more logs. This has now happened few times and maybe there is some async problem here. E.g. when checking with mqtt it was showing some pid number for detect stream but when doing ps -aux|grep ffmpeg I could not find the ffmpeg line for the katos_sub which is used for detection.
Frigate was still recording just fine the katos main stream but the sub was not visible to frigate but still accessible with web,vlc and ffmpegprobe.
Is there anyway to enable more logs?
if frigate does not receive frames then it already restarts the ffmpeg process (which can be seen in the logs). it is also worth noting that the camera_fps
field in mqtt can be used to indicate whether the detect stream is currently running as it will be 0 when the stream is closed
it has been seen before where go2rtc live view would work (mse / webrtc) but it fails to output an rtsp stream that works for frigate. However, this was the case on older go2rtc versions not recent ones.
Ok, next time I will also check the camera_fps from mqtt. Is there also way to enforce restart of the detetction stream? To me it seemed like frigate is waiting for ffmpeg to exit where in reality it had already exited.
I also tested the rtsp stream directly from go2rtc and the detection stream was working fine, I was able to record it with ffmpeg get the probe and also view with vlc, only thing that was not happening was frigate to restart the detection stream.
the restart is already fully enforced. if the ffmpeg process doesn't exit gracefully after 30 seconds frigate will forcibly exit the process
you may find better results running the go2rtc streams as ffmpeg:
instead of directly through go2rtc
hmm in my case I never see the timeout. What happens if exit is ok and next restart you get no frames and you do end up exiting like in the log? Should it loop forever and try to restart ffmepg?
yes, it will continue to restart if no frames are received. This logic has not changed for many frigate versions
Some more logs from last night
2023-11-15 11:47:58.960146116 [INFO] Starting Frigate...
2023-11-15 11:47:59.704740293 [2023-11-15 11:47:59] frigate.app INFO : Starting Frigate (0.12.1-367d724)
2023-11-15 11:47:59.738729099 [2023-11-15 11:47:59] peewee_migrate INFO : Starting migrations
2023-11-15 11:47:59.741316440 [2023-11-15 11:47:59] peewee_migrate INFO : There is nothing to migrate
2023-11-15 11:47:59.753280411 [2023-11-15 11:47:59] detector.coral INFO : Starting detection process: 577
2023-11-15 11:48:02.399108362 [2023-11-15 11:47:59] frigate.app INFO : Output process started: 579
2023-11-15 11:48:02.406697223 [2023-11-15 11:47:59] frigate.detectors.plugins.edgetpu_tfl INFO : Attempting to load TPU as usb
2023-11-15 11:48:02.406812316 [2023-11-15 11:48:02] frigate.detectors.plugins.edgetpu_tfl INFO : TPU found
2023-11-15 11:48:02.406867543 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for talli_etu: 586
2023-11-15 11:48:02.406912138 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for talli_taka: 587
2023-11-15 11:48:02.406954665 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for talli_sivu: 589
2023-11-15 11:48:02.406997172 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for takaovi: 590
2023-11-15 11:48:02.407038682 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for etuovi: 592
2023-11-15 11:48:02.407074882 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for katos: 594
2023-11-15 11:48:02.407112060 [2023-11-15 11:47:59] frigate.app INFO : Camera processor started for katostie: 595
2023-11-15 11:48:02.407147015 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for talli_etu: 597
2023-11-15 11:48:02.407187057 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for talli_taka: 601
2023-11-15 11:48:02.407225096 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for talli_sivu: 605
2023-11-15 11:48:02.407256908 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for takaovi: 612
2023-11-15 11:48:02.407280940 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for etuovi: 621
2023-11-15 11:48:02.407304715 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for katos: 627
2023-11-15 11:48:02.407326735 [2023-11-15 11:47:59] frigate.app INFO : Capture process started for katostie: 681
2023-11-15 16:00:40.252470046 [2023-11-15 16:00:40] watchdog.katos INFO : No frames received from katos in 20 seconds. Exiting ffmpeg...
2023-11-15 16:00:40.252519701 [2023-11-15 16:00:40] watchdog.katos INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 16:00:40.445926091 [2023-11-15 16:00:40] frigate.video ERROR : katos: Unable to read frames from ffmpeg process.
2023-11-15 16:00:40.445972836 [2023-11-15 16:00:40] frigate.video ERROR : katos: ffmpeg process is not running. exiting capture thread...
2023-11-15 16:00:50.447519403 [2023-11-15 16:00:50] watchdog.katos ERROR : Ffmpeg process crashed unexpectedly for katos.
2023-11-15 16:00:50.447571088 [2023-11-15 16:00:50] watchdog.katos ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 16:00:50.447616277 [2023-11-15 16:00:50] ffmpeg.katos.detect ERROR : [rtsp @ 0x562c8cc7db40] RTP: PT=60: bad cseq d41b expected=eb26
2023-11-15 16:43:50.562157224 [2023-11-15 16:43:50] watchdog.katos INFO : No frames received from katos in 20 seconds. Exiting ffmpeg...
2023-11-15 16:43:50.562168892 [2023-11-15 16:43:50] watchdog.katos INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 16:43:50.620302380 [2023-11-15 16:43:50] frigate.video ERROR : katos: Unable to read frames from ffmpeg process.
2023-11-15 16:43:50.620360838 [2023-11-15 16:43:50] frigate.video ERROR : katos: ffmpeg process is not running. exiting capture thread...
2023-11-15 16:44:00.621919966 [2023-11-15 16:44:00] watchdog.katos ERROR : Ffmpeg process crashed unexpectedly for katos.
2023-11-15 16:44:00.621931611 [2023-11-15 16:44:00] watchdog.katos ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 16:44:00.621968072 [2023-11-15 16:44:00] ffmpeg.katos.detect ERROR : [rtsp @ 0x555dda7c8b40] RTP: PT=60: bad cseq b5de expected=6315
2023-11-15 23:49:11.900268744 [2023-11-15 23:49:11] watchdog.katos INFO : katos exceeded fps limit. Exiting ffmpeg...
2023-11-15 23:49:11.900372795 [2023-11-15 23:49:11] watchdog.katos INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:53:57.814418614 [2023-11-15 23:53:51] watchdog.katostie INFO : No frames received from katostie in 20 seconds. Exiting ffmpeg...
2023-11-15 23:54:00.745106118 [2023-11-15 23:53:51] watchdog.talli_sivu INFO : No frames received from talli_sivu in 20 seconds. Exiting ffmpeg...
2023-11-15 23:54:02.817027904 [2023-11-15 23:53:51] watchdog.takaovi INFO : No frames received from takaovi in 20 seconds. Exiting ffmpeg...
2023-11-15 23:54:09.051259960 [2023-11-15 23:53:51] watchdog.talli_taka INFO : No frames received from talli_taka in 20 seconds. Exiting ffmpeg...
2023-11-15 23:54:09.737436133 [2023-11-15 23:53:51] watchdog.talli_etu INFO : No frames received from talli_etu in 20 seconds. Exiting ffmpeg...
2023-11-15 23:54:11.603059414 [2023-11-15 23:53:55] watchdog.takaovi INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:22.215919633 [2023-11-15 23:53:55] watchdog.talli_taka INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:23.644007459 [2023-11-15 23:53:55] watchdog.talli_sivu INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:25.615518936 [2023-11-15 23:53:55] watchdog.katostie INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:26.536913601 [2023-11-15 23:53:56] watchdog.talli_etu INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.254924651 [2023-11-15 23:54:10] watchdog.etuovi ERROR : No new recording segments were created for etuovi in the last 120s. restarting the ffmpeg record process...
2023-11-15 23:54:27.490031415 [2023-11-15 23:54:23] watchdog.etuovi INFO : Terminating the existing ffmpeg process...
2023-11-15 23:54:27.490241774 [2023-11-15 23:54:26] watchdog.etuovi INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.490359441 [2023-11-15 23:54:26] watchdog.takaovi INFO : FFmpeg did not exit. Force killing...
2023-11-15 23:54:27.490429587 [2023-11-15 23:54:26] watchdog.talli_taka INFO : FFmpeg did not exit. Force killing...
2023-11-15 23:54:27.554172743 [2023-11-15 23:54:27] frigate.video ERROR : takaovi: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.554440233 [2023-11-15 23:54:27] watchdog.talli_etu INFO : FFmpeg did not exit. Force killing...
2023-11-15 23:54:27.554580317 [2023-11-15 23:54:27] watchdog.katostie INFO : FFmpeg did not exit. Force killing...
2023-11-15 23:54:27.555259520 [2023-11-15 23:54:27] frigate.video ERROR : takaovi: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:54:27.559513741 [2023-11-15 23:54:27] watchdog.talli_sivu INFO : FFmpeg did not exit. Force killing...
2023-11-15 23:54:27.559808284 [2023-11-15 23:54:27] watchdog.takaovi ERROR : No new recording segments were created for takaovi in the last 120s. restarting the ffmpeg record process...
2023-11-15 23:54:27.571663067 [2023-11-15 23:54:27] frigate.video ERROR : talli_taka: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.571700042 [2023-11-15 23:54:27] watchdog.takaovi INFO : Terminating the existing ffmpeg process...
2023-11-15 23:54:27.581426000 [2023-11-15 23:54:27] frigate.video ERROR : talli_etu: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.591512654 [2023-11-15 23:54:27] frigate.video ERROR : talli_taka: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:54:27.591544243 [2023-11-15 23:54:27] watchdog.takaovi INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.591568709 [2023-11-15 23:54:27] frigate.video ERROR : talli_etu: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.596254229 [2023-11-15 23:54:27] frigate.video ERROR : katostie: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.596311871 [2023-11-15 23:54:27] frigate.video ERROR : talli_etu: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:54:27.608019380 [2023-11-15 23:54:27] frigate.video ERROR : talli_sivu: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.623801322 [2023-11-15 23:54:27] frigate.video ERROR : katostie: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:54:27.623849866 [2023-11-15 23:54:27] watchdog.talli_etu ERROR : No new recording segments were created for talli_etu in the last 120s. restarting the ffmpeg record process...
2023-11-15 23:54:27.922429162 [2023-11-15 23:54:27] watchdog.talli_sivu ERROR : No new recording segments were created for talli_sivu in the last 120s. restarting the ffmpeg record process...
2023-11-15 23:54:27.922493316 [2023-11-15 23:54:27] watchdog.katostie ERROR : No new recording segments were created for katostie in the last 120s. restarting the ffmpeg record process...
2023-11-15 23:54:27.922522411 [2023-11-15 23:54:27] watchdog.talli_etu INFO : Terminating the existing ffmpeg process...
2023-11-15 23:54:27.922547271 [2023-11-15 23:54:27] watchdog.katostie INFO : Terminating the existing ffmpeg process...
2023-11-15 23:54:27.922570566 [2023-11-15 23:54:27] watchdog.talli_etu INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.922593948 [2023-11-15 23:54:27] watchdog.talli_sivu INFO : Terminating the existing ffmpeg process...
2023-11-15 23:54:27.922617120 [2023-11-15 23:54:27] watchdog.katostie INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.922638395 [2023-11-15 23:54:27] watchdog.talli_sivu INFO : Waiting for ffmpeg to exit gracefully...
2023-11-15 23:54:27.922661531 [2023-11-15 23:54:27] frigate.video ERROR : talli_sivu: Unable to read frames from ffmpeg process.
2023-11-15 23:54:27.922684478 [2023-11-15 23:54:27] frigate.video ERROR : talli_sivu: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:54:29.130816552 [2023-11-15 23:54:29] frigate.video ERROR : etuovi: Unable to read frames from ffmpeg process.
2023-11-15 23:54:29.130821444 [2023-11-15 23:54:29] frigate.video ERROR : etuovi: ffmpeg process is not running. exiting capture thread...
2023-11-15 23:55:12.670811422 [2023-11-15 23:54:40] watchdog.talli_taka ERROR : Ffmpeg process crashed unexpectedly for talli_taka.
2023-11-15 23:55:12.677017103 [2023-11-15 23:54:47] watchdog.talli_etu ERROR : Ffmpeg process crashed unexpectedly for talli_etu.
2023-11-15 23:55:12.677019698 [2023-11-15 23:54:47] watchdog.katostie ERROR : Ffmpeg process crashed unexpectedly for katostie.
2023-11-15 23:55:12.677024763 [2023-11-15 23:54:48] watchdog.talli_sivu ERROR : Ffmpeg process crashed unexpectedly for talli_sivu.
2023-11-15 23:55:12.677026364 [2023-11-15 23:54:48] watchdog.takaovi ERROR : Ffmpeg process crashed unexpectedly for takaovi.
2023-11-15 23:55:12.677250528 [2023-11-15 23:55:12] watchdog.talli_taka ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.684077596 [2023-11-15 23:54:47] watchdog.etuovi ERROR : Ffmpeg process crashed unexpectedly for etuovi.
2023-11-15 23:55:12.713509919 [2023-11-15 23:55:12] watchdog.talli_etu ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.722243803 [2023-11-15 23:55:12] watchdog.katostie ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.722300876 [2023-11-15 23:55:12] watchdog.talli_sivu ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.722329646 [2023-11-15 23:55:12] watchdog.takaovi ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.722372063 [2023-11-15 23:55:12] watchdog.etuovi ERROR : The following ffmpeg logs include the last 100 lines prior to exit.
2023-11-15 23:55:12.736430406 [2023-11-15 23:55:12] ffmpeg.talli_etu.detect ERROR : More than 1000 frames duplicated
2023-11-15 23:55:12.736545718 [2023-11-15 23:55:12] ffmpeg.katostie.detect ERROR : More than 1000 frames duplicated
2023-11-15 23:55:12.736587386 [2023-11-15 23:55:12] ffmpeg.talli_sivu.detect ERROR : More than 1000 frames duplicated
2023-11-15 23:55:12.736619159 [2023-11-15 23:55:12] ffmpeg.etuovi.detect ERROR : [h264_qsv @ 0x556892406900] A decode call did not consume any data: expect more data at input (-10)
2023-11-15 23:55:12.736646774 [2023-11-15 23:55:12] ffmpeg.katostie.detect ERROR : More than 10000 frames duplicated
2023-11-15 23:55:12.736670987 [2023-11-15 23:55:12] ffmpeg.talli_etu.detect ERROR : More than 10000 frames duplicated
2023-11-15 23:55:12.736694529 [2023-11-15 23:55:12] ffmpeg.talli_sivu.detect ERROR : More than 10000 frames duplicated
2023-11-15 23:55:12.736716827 [2023-11-15 23:55:12] ffmpeg.etuovi.detect ERROR : Last message repeated 2 times
2023-11-15 23:55:13.141500307 [2023-11-15 23:55:13] ffmpeg.talli_taka.record ERROR : [segment @ 0x563ddd65c7c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
2023-11-15 23:55:13.142139023 [2023-11-15 23:55:13] ffmpeg.talli_taka.record ERROR : [segment @ 0x563ddd65c7c0] Non-monotonous DTS in output stream 0:0; previous: 0, current: 0; changing to 1. This may result in incorrect timestamps in the output file.
2023-11-15 23:55:13.142262508 [2023-11-15 23:55:13] watchdog.talli_taka INFO : Terminating the existing ffmpeg process...
2023-11-15 23:55:13.142338024 [2023-11-15 23:55:13] watchdog.talli_taka INFO : Waiting for ffmpeg to exit gracefully...
All the other cameras recoved but "katos" camera is just not coming back online. Now also the capture ffmpeg session didn't recover. From the katos camera the last seen logging is always waiting for ffmpeg to exit. 2023-11-15 23:49:11.900372795 [2023-11-15 23:49:11] watchdog.katos INFO : Waiting for ffmpeg to exit gracefully...
There is nothing in go2rtc logs and ffprobe doesn't give errors when accessing both detect and record streams.
Is there anyway to enable more logs on this? To me it seems that it's just stuck waiting.
for starts I would suggest using preset-vaapi not qsv, qsv has often caused weird bugs and issues
no 1 day solid running with preset-vaapi. After another day I close this as resolved. @NickM-27 thank you for the support!
Working solid with vaapi
Describe the problem you are having
I have a problem where the sub stream just stops and frigate doesn't restart the ffmpeg process for the sub_stream. When accessing the substream it works perfectly fine. How ever it is not able to recover from the failure it received. I also dont see anything wrong in go2rtc logs. To me it seems like watchdog waits for ever for something that never happens.
I was thinking that could/should there bere a mqtt API to show possible error if camera detection stream doesn't receive frames for x period of time and after this one could force restart of the detection stream (also through mqtt).
Version
0.12
Frigate config file
Relevant log output
FFprobe output from your camera
Frigate stats
No response
Operating system
Debian
Install method
Docker Compose
Coral version
USB
Network connection
Wired
Camera make and model
Dahua
Any other information that may be helpful
Everything is else than the detect stream is working perfect. I can access streams and recordings inside frigate.