Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Camera Support]: Stuck/spinning recording playback #6498

Closed
TarheelGrad1998 opened this issue May 15, 2023 · 19 comments
Closed

[Camera Support]: Stuck/spinning recording playback #6498

TarheelGrad1998 opened this issue May 15, 2023 · 19 comments

Comments

@TarheelGrad1998
Copy link

Describe the problem you are having

I have a Foscam C1 that I am using as a "baby cam" in my daughter's room. That is, it is not doing object detection but rather recording video and audio when there is motion detected. This seems to be working OK however regularly when going to recordings in the UI and attempting to play, the spinner shows but the video never plays. If I try to play the same video from disk, it plays fine. There is no message in the browser console. However, potentially relevant Frigate logs are below.

I have tried tweaking configurations but without luck. Restarting Frigate will do nothing for old recordings but usually will get future recordings to work but only for about an hour after the restart. From there it is hit or miss whether they recordings play or not. Everything else is working fine, as do other cameras (though they are not C1).

Thanks for any assistance.

Version

0.12.0-DA3E197

Frigate config file

go2rtc:
  streams:
    becca: 
      - rtsp://user:{FRIGATE_RTSP_PASSWORD}@[ip]:554/videoMain
      - "ffmpeg:becca#audio=aac"   

cameras:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/becca
          input_args: preset-rtsp-restream
          roles:
            - detect
            - record
    detect:
      width: 1280
      height: 720 
      fps: 5 
    objects:
      track: []
    record: 
      enabled: True            
      retain:
        days: 3
        mode: motion

Relevant log output

2023-05-14 19:49:30.830028578  [2023-05-14 19:49:30] watchdog.becca                 ERROR   : Ffmpeg process crashed unexpectedly for becca.
2023-05-14 19:49:30.836963412  [2023-05-14 19:49:30] watchdog.becca                 ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-14 19:49:30.836971723  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : PTS 3000514593, next:32550433625 invalid dropping st:1
2023-05-14 19:49:30.836974567  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : DTS 3000515617, next:32550561625 st:1 invalid dropping
2023-05-14 19:49:30.836977134  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : PTS 3000515617, next:32550561625 invalid dropping st:1
2023-05-14 19:49:30.836979634  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : DTS 3000516641, next:32550689625 st:1 invalid dropping
[...repeated...]
2023-05-14 19:49:30.859088251  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : DTS 3000549294, next:32556321625 st:1 invalid dropping
2023-05-14 19:49:30.859095970  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : PTS 3000549294, next:32556321625 invalid dropping st:1
2023-05-14 19:49:30.859098533  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : rtsp://127.0.0.1:8554/becca: Connection timed out
2023-05-14 19:49:30.859545156  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   :     Last message repeated 1 times
2023-05-14 19:49:30.859553839  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : [h264_qsv @ 0x5565a91704c0] A decode call did not consume any data: expect more data at input (-10)
2023-05-14 19:49:30.860106526  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : rtsp://127.0.0.1:8554/becca: Connection timed out
2023-05-14 19:49:30.865233941  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : [h264_qsv @ 0x5565a91704c0] A decode call did not consume any data: expect more data at input (-10)
2023-05-14 19:49:30.865671760  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : rtsp://127.0.0.1:8554/becca: Connection timed out
2023-05-14 19:49:30.865680280  [2023-05-14 19:49:30] ffmpeg.becca.detect            ERROR   : [h264_qsv @ 0x5565a91704c0] A decode call did not consume any data: expect more data at input (-10)
2023-05-14 19:49:35.980350306  [2023-05-14 19:49:35] frigate.video                  ERROR   : becca: Unable to read frames from ffmpeg process.
2023-05-14 19:49:35.981111048  [2023-05-14 19:49:35] frigate.video                  ERROR   : becca: ffmpeg process is not running. exiting capture thread...
2023-05-14 19:49:40.854835998  [2023-05-14 19:49:40] watchdog.becca                 ERROR   : Ffmpeg process crashed unexpectedly for becca.
2023-05-14 19:49:40.854845700  [2023-05-14 19:49:40] watchdog.becca                 ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2023-05-14 19:49:40.854848780  [2023-05-14 19:49:40] ffmpeg.becca.detect            ERROR   : rtsp://127.0.0.1:8554/becca: Invalid data found when processing input

Seen in Nginx logs when trying to playback:
2023-05-14 19:26:08.463439670  172.20.0.1 - - [14/May/2023:19:26:08 -0400] "GET /vod/2023-05/14/11/becca/America,New_York/seg-24-v1-a1.ts HTTP/1.1" 200 478648 "http://[domain]:8001/recording/becca/2023-05-14/11" "Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36" "-"
2023-05-14 19:26:08.581068644  2023/05/14 19:26:08 [warn] 135#135: *520 ngx_http_vod_update_track_timescale: last frame dts 4294967296 greater than clip end dts 1078920 while reading media header, client: 172.20.0.1, server: , request: "GET /vod/2023-05/14/11/becca/America,New_York/seg-25-v1-a1.ts HTTP/1.1", host: "[domain]:8001", referrer: "http://[domain]:8001/recording/becca/2023-05-14/11"

FFprobe output from your camera

Metadata:                                                                                                                          
    title           : videoMain                                                                                                      
  Duration: N/A, start: 0.000000, bitrate: N/A                                                                                       
  Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x720, 90k tbr, 90k tbn                                      
  Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s

Frigate stats

{"basement":{"camera_fps":10.0,"capture_pid":300,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":13139,"pid":295,"process_fps":9.8,"skipped_fps":0.0},"becca":{"camera_fps":5.0,"capture_pid":302,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":28520,"pid":297,"process_fps":5.0,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"1.8"},"1":{"cpu":"0.0","mem":"0.0"},"117":{"cpu":"0.0","mem":"0.0"},"118":{"cpu":"0.0","mem":"0.0"},"13139":{"cpu":"8.0","mem":"0.1"},"135":{"cpu":"0.0","mem":"0.0"},"136":{"cpu":"0.0","mem":"0.1"},"137":{"cpu":"0.0","mem":"0.1"},"138":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"17":{"cpu":"0.0","mem":"0.0"},"18867":{"cpu":"21.9","mem":"0.4"},"18877":{"cpu":"2.7","mem":"0.0"},"20795":{"cpu":"0.0","mem":"0.0"},"20864":{"cpu":"0.0","mem":"0.0"},"20883":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"283":{"cpu":"0.0","mem":"0.0"},"28520":{"cpu":"12.0","mem":"0.2"},"28532":{"cpu":"2.7","mem":"0.1"},"288":{"cpu":"0.3","mem":"0.0"},"289":{"cpu":"0.0","mem":"0.1"},"29":{"cpu":"0.0","mem":"0.0"},"290":{"cpu":"1.7","mem":"0.1"},"292":{"cpu":"2.3","mem":"0.2"},"295":{"cpu":"1.7","mem":"0.1"},"296":{"cpu":"0.0","mem":"0.0"},"297":{"cpu":"1.0","mem":"0.1"},"298":{"cpu":"0.0","mem":"0.0"},"299":{"cpu":"3.7","mem":"0.1"},"30":{"cpu":"0.0","mem":"0.0"},"300":{"cpu":"2.3","mem":"0.1"},"301":{"cpu":"0.0","mem":"0.0"},"302":{"cpu":"2.3","mem":"0.1"},"31":{"cpu":"0.0","mem":"0.0"},"312":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"33":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"44":{"cpu":"0.0","mem":"0.0"},"79":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"83":{"cpu":"0.0","mem":"0.0"},"90":{"cpu":"12.6","mem":"0.1"},"96":{"cpu":"3.7","mem":"1.4"},"MiB":{"cpu":"3662.1","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":29.22,"pid":289}},"front_yard":{"camera_fps":5.1,"capture_pid":299,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":18867,"pid":292,"process_fps":5.1,"skipped_fps":0.0},"gpu_usages":{"error-gpu":{"gpu":-1,"mem":-1}},"service":{"last_updated":1684159125,"latest_version":"0.12.0","storage":{"/dev/shm":{"free":60.1,"mount_type":"tmpfs","total":67.1,"used":7.0},"/media/frigate/clips":{"free":2180625.6,"mount_type":"btrfs","total":3836015.3,"used":1655389.7},"/media/frigate/recordings":{"free":2180625.6,"mount_type":"btrfs","total":3836015.3,"used":1655389.7},"/tmp/cache":{"free":983.7,"mount_type":"tmpfs","total":1000.0,"used":16.3}},"temperatures":{},"uptime":233098,"version":"0.12.0-da3e197"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wireless

Camera make and model

Foscam C1

Any other information that may be helpful

No response

@NickM-27
Copy link
Collaborator

if you look at the network tools in the browser, which call is hanging? (show a screenshot of it)

@TarheelGrad1998
Copy link
Author

I do not see signs that anything is hanging.
Screenshot 2023-05-15 102356

@blakeblackshear
Copy link
Owner

What do you see in chrome://media-internals when attempting playback?

@TarheelGrad1998
Copy link
Author

I saved the log from that page while the video is spinning, and copy/pasted what looked like the relevant sections into the attached. I've removed domains, and also fyi, port 8001 I have mapped to 5000 in Docker (as I've already used 5000).

Let me know if you need anything else.

media-internals.txt

@blakeblackshear
Copy link
Owner

I don't see any playback errors. I'm not sure why that happens, but it looks like the camera starts getting its timestamps mixed up.

@TarheelGrad1998
Copy link
Author

I found that there was actually a camera firmware update, but after that and restarting Frigate it worked for about 1.5 hours and then the spins returned. :(

Is there maybe an alternate config I could try? I found the JPEG options but then I lose the audio.

@belperite
Copy link

I get this as well with Amcrest cameras. Most of the recordings are OK, but some I just get the spinner. In the browser console, I just get "IDEOJS: WARN: Problem encountered with playlist 0-index-v1-a1.m3u8. Trying again since it is the only playlist". There doesn't appear to be anything of relevance in the frigate logs at the time of access.

@NickM-27
Copy link
Collaborator

Please check media internals as was recommended above

@belperite
Copy link

@NickM-27 Any suggestions for firefox users? I can't install chrome on this machine.

@belperite
Copy link

belperite commented Jun 13, 2023

media-internals.txt

@NickM-27 OK, I've worked around it and got Chrome installed, please see attached. It turns out, the clip plays in Chrome but not Firefox, any ideas?

Edit: Might be related to videojs/http-streaming#344 ?

@NickM-27
Copy link
Collaborator

It turns out, the clip plays in Chrome but not Firefox, any ideas?

Firefox has worse handing of codecs than chrome. That along with limited debugging makes it difficult to know what the issue is

Edit: Might be related to videojs/http-streaming#344 ?

potentially

@github-actions
Copy link

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.

@github-actions github-actions bot added the stale label Jul 14, 2023
@TarheelGrad1998
Copy link
Author

I am still having the issue. I have moved Frigate to a different machine and it still happens, so yes it is probably the camera. Is there no workaround?

@github-actions github-actions bot removed the stale label Jul 15, 2023
@Caddyman68
Copy link

media-internals.txt

@NickM-27 OK, I've worked around it and got Chrome installed, please see attached. It turns out, the clip plays in Chrome but not Firefox, any ideas?

Edit: Might be related to videojs/http-streaming#344 ?

Funny because mine is just the opposite - works in Firefox and not in Chrome. Worst part is it doesn't work in the Home Assistant Frigate card on the Android app. Unless I lower record resolution to 640x480. Then it plays okay but is recorded with a resolution too low to make out things clearly on my computer screen even when zoomed in.

@TarheelGrad1998
Copy link
Author

I'm good with closing this out. I think we've got several issues here tangled up. My issue continues within Frigate but works fine within the Home Assistant automation, so that's good enough for me.

@NickM-27 NickM-27 closed this as completed Aug 3, 2023
@ThePolarCat
Copy link

I have the same issue however, I got some success when I set the config to record in h264 and enable webrtc

@GrumpyMeow
Copy link
Contributor

I seem to have experienced this (or alike) issue. I eventually found out that i had my camera output a h265 with restream via go2rtc. This resulted in a h265 stream on playback in the browser (Chromium Linux). I found this out by taking the m3u8 stream and opening it in VLC. The codec-info will then display h265 which my browser does not support.

I changed my camera stream to h264 and it started to work.

@rmaher001
Copy link

rmaher001 commented Feb 8, 2025

I am experiencing a similar issue with two different cameras, Reolink E1 Zoom and a Tapo 120C. Two observations: If I disable recording the audio, the issue is gone. When I export a video clip, the playback is flawless. @GrumpyMeow did you change the stream to h264 at the camera or in frigate/go2rtc? Any suggestions?

@GrumpyMeow
Copy link
Contributor

I changed the format from h265 to h264 I’m the camera itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants