silvanmelchior / RPi_Cam_Web_Interface

A web interface for the RPi Cam
MIT License
1.53k stars 492 forks source link

End of recording causes temporary freeze #693

Closed Andres9713 closed 6 months ago

Andres9713 commented 6 months ago

Hi, I am using the latest RPI_Cam_Interface on a few different Raspberry Pi Zero 2W's, running on bullseye. My issue is that whenever a video recording is stopped, either manually or due to reaching a 'video split' interval, the preview window freezes for a few seconds (maybe 10 seconds) before becoming responsive again. The issue is that in 'Video Split' mode, the Pi simply stops recording after the freeze (once the preview starts the 'record video' button goes back to blue). Notably, this freezing issue happens even when 'boxing mode' is off and the length of the freeze does not appear to be related to the length of the recording prior to the end of the recording.

The .h264 files are written to the local SD. I am not using motion detection, and the motion detect mode is set to 'monitor'.

The last few lines of the log (/var/www/scheduleLog.txt) around one of these freezes/failures to continue recording after split read:

[2024/03/08 12:20:21] New period detected 0
[2024/03/08 12:20:21] Scheduled management tasks. Next at 1709922021
{2024/03/08 12:21:28} Capturing with split of 30 seconds
{2024/03/08 12:21:28} Executing macro /var/www/macros/start_vid.sh "/var/www/media/vi_0002_20240308_122128.mp4" &
{2024/03/08 12:21:28} Capturing started
{2024/03/08 12:21:58} Stopping video from timer
{2024/03/08 12:21:58} Capturing stopped
{2024/03/08 12:21:58} Executing macro /var/www/macros/end_vid.sh "/var/www/media/vi_0002_20240308_122128.h264" &
{2024/03/08 12:21:58} Restarting next split of 30 seconds
{2024/03/08 12:21:58} Error: Could not create connection camera -> video converter
{2024/03/08 12:22:09} Watchdog detected problem. Stopping{2024/03/08 12:22:09} SIGINT/SIGTERM received, stopping
{2024/03/08 12:22:14} RaspiMJPEG Version 5.10.2
{2024/03/08 12:22:14} recommended video buffer size 65536
{2024/03/08 12:22:14} h264 size set to 131072
{2024/03/08 12:22:14} recommended video buffers 1
{2024/03/08 12:22:14} h264 buffers set to recommended 1
{2024/03/08 12:22:14} Set up internal detect width=64 height=61
{2024/03/08 12:22:14} Opening FIFO 0 /var/www/FIFO 7
{2024/03/08 12:22:14} Opening FIFO 1 /var/www/FIFO11 8
{2024/03/08 12:22:14} MJPEG streaming, ready to receive commands
{2024/03/08 12:22:14} send smd 9
{2024/03/08 12:22:14} Starting command loop
[2024/03/08 12:22:14] Reload parameters command requested
[2024/03/08 12:22:14] Scheduler loop is started
[2024/03/08 12:22:15] New period detected 0
[2024/03/08 12:22:15] Scheduled management tasks. Next at 1709922135

Thank you for any input on this.

Andres9713 commented 6 months ago

After more searching, I found the following post on the forum: https://forums.raspberrypi.com/viewtopic.php?t=63276&start=4100#p1166424 which suggested adding a 2000 ms second Buffer. This solved both of my issues (the freezes at the end of video recordings, and the resulting inability to use Video Split). So, I'm closing this issue.