question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constant RPi4 Watchdog ffmpeg shutdowns causing CPU to spike hard

See original GitHub issue

Describe the bug On my RPi4 4GB, I am getting ffmpeg errors in the console. These errors don’t always start immedateily. A lot of the times, several clips will be written before I see these errors. This is running on the 32-bit Raspberry OS. Currently not using a Coral device since I’m waiting on a USB one to come available.

It should be noted that clips are still being generated just fine even with these errors. However, when these errors begin, CPU utilization jumps to 200%+ according to top. Python 3 seems to be the culprit according to what is showing in top. I am using a single zone here. I’ve not messed with zones before so its possible I have it wrong. My goal is just to record clips while cars are seen passing through the zone which is a “road”.

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x17d3ce0] moov atom not found                                              
frigate    | /tmp/cache/driveway-20201230130715.mp4: Invalid data found when processing input                       
frigate    | frigate.events                 INFO    : bad file: driveway-20201230130715.mp4                         
frigate    | watchdog.driveway              INFO    : Terminating the existing ffmpeg process...                    
frigate    | watchdog.driveway              INFO    : Waiting for ffmpeg to exit gracefully...                      
frigate    | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1d93ce0] moov atom not found                                              
frigate    | /tmp/cache/driveway-20201230130725.mp4: Invalid data found when processing input                       
frigate    | frigate.events                 INFO    : bad file: driveway-20201230130725.mp4                         
frigate    | watchdog.driveway              INFO    : Terminating the existing ffmpeg process...                    
frigate    | watchdog.driveway              INFO    : Waiting for ffmpeg to exit gracefully...                      
frigate    | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1e33ce0] moov atom not found

Version of frigate image: blakeblackshear/frigate:0.8.0-beta3-armv7

docker-compose.yml

services:
  frigate:
      container_name: frigate
      restart: unless-stopped
      privileged: true
      image: blakeblackshear/frigate:0.8.0-beta3-armv7
      volumes:
        - /dev/bus/usb:/dev/bus/usb
        - /etc/localtime:/etc/localtime:ro
        - /home/rodman/frigate/config:/config                                                      
        - /home/rodman/frigate/clips:/media/frigate/clips                                          
        #- <path_to_directory_for_recordings>:/media/frigate/recordings                                      
        - type: tmpfs # 1GB of memory, reduces SSD/SD Card wear                                              
          target: /tmp/cache
          tmpfs:
            size: 100000000
      ports:
        - "5000:5000"
        - "1935:1935"
      environment:
        FRIGATE_RTSP_PASSWORD: "password"

Config file

mqtt:
  host: 10.200.200.44
  user: frigate
  password: password

save_clips:                        
  max_seconds: 300
  retain:
      default: 10

ffmpeg:
  global_args: -hide_banner -loglevel info

ffmpeg:
  hwaccel_args:
    - -c:v
    - h264_mmal

objects:
  track:
   - car

cameras:
  driveway:
    ffmpeg:
      inputs:
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@10.200.200.14:554/cam/realmonitor?channel=1&subtype=1
          roles:
            - rtmp
            - detect
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@10.200.200.14:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - clips
    height: 480
    width: 704
    fps: 5
    save_clips:
      enabled: True
      pre_capture: 1
    zones:
      road:
        coordinates: 0,198,1,106,618,72,663,119  

Logs

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x17d3ce0] moov atom not found                                              
frigate    | /tmp/cache/driveway-20201230130715.mp4: Invalid data found when processing input                       
frigate    | frigate.events                 INFO    : bad file: driveway-20201230130715.mp4                         
frigate    | watchdog.driveway              INFO    : Terminating the existing ffmpeg process...                    
frigate    | watchdog.driveway              INFO    : Waiting for ffmpeg to exit gracefully...                      
frigate    | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1d93ce0] moov atom not found                                              
frigate    | /tmp/cache/driveway-20201230130725.mp4: Invalid data found when processing input                       
frigate    | frigate.events                 INFO    : bad file: driveway-20201230130725.mp4                         
frigate    | watchdog.driveway              INFO    : Terminating the existing ffmpeg process...                    
frigate    | watchdog.driveway              INFO    : Waiting for ffmpeg to exit gracefully...                      
frigate    | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x1e33ce0] moov atom not found

Frigate debug stats

{"detection_fps":6.3,"detectors":{"coral":{"detection_start":1609356406.121991,"inference_speed":150.34,"pid":30}},"driveway":{"camera_fps":5.0,"capture_pid":34,"detection_fps":6.3,"pid":33,"process_fps":1.9,"skipped_fps":0.0}}

FFprobe from your camera

Run the following command and paste output below

ffprobe <stream_url>

I can't seem to figure this out.  I can exec in but running that command with my URL doesn't work.

Screenshots Screenshot from 2020-12-30 13-17-50

Computer Hardware

  • OS: Raspberry OS 32bit
  • Virtualization: None. Just standard Docker container
  • Coral Version: None Yet. Just CPU
  • Network Setup: Wired

Camera Info:

  • Manufacturer: Dahua
  • Model: [e.g. 5442
  • Resolution: Substream is 704x480 while main stream is 2688x1520. All H.254
  • FPS: 5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yllarcommented, Dec 31, 2020
0reactions
biggen1684commented, Dec 31, 2020

Wow. Excellent! Man I was pulling my hair out with my Pi and about ready to throw in the towel. Thanks for catching this!

I guess I don’t have this issue with my other installation of Frigate on my NUC because the camera its monitoring has a far less busy “scene”. The Frigate/PI installation is monitoring a far busier road it was leading to the cache running out of space.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No space left on device · Issue #2006 · blakeblackshear/frigate
My "docker host" slowly dies. Then it crashes frigate. I have added extra disk space but that also is filled with something but...
Read more >
ChangeLog.openSUSE-Leap-15.3-x86_64 ... - BYU Linux Club
Update to 1.6.9 - * Fix a regression introduced in version 1.6.8, which caused - GeoIP_database_info to erroneously return NULL. -- Changes for...
Read more >
Read more - Index of /pub
Fix shutdown of slurmdbd plugin to correctly notice when the agent thread finishes. * Fix slurmctld segfault due to job array --batch features...
Read more >
https://es.tldp.org/mirror/OpenBSD/Changelogs/Chan...
Uncomfortable bug found the hard way by deraadt@ CVSROOT: /cvs Module name: ... seems to have started somewhere between 6.8 and now causing...
Read more >
Ask Noah Show - Podcast Addict
The Ask Noah Show is a weekly talk radio show where we focus on Linux and Open Source technology. We invite the community...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found