blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.2k stars 1.76k forks source link

[Support]: Live camera view works on desktop but not on mobile #7325

Closed UPEngineer closed 1 year ago

UPEngineer commented 1 year ago

Describe the problem you are having

I have a weird issue going on and I cannot find out what is causing it. I have gotortc configured along with the corresponding restream option. I can view live video on the desktop but I cannot view it on the android phone. I have 3 other cameras and they work fine, it is just this Dahua camera. Weird thing is if I click on debug, the live video shows just fine.

In my config file below, it is the shed and shed_sub camera.

Version

0.12.0

Frigate config file

go2rtc:
  streams:
    side_yard:
      - rtsp://admin:****$@192.168.20.5:554/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:side_yard#audio=aac"
    side_yard_sub:
      - rtsp://admin:*****$@192.168.20.5:554/cam/realmonitor?channel=1&subtype=1
      - "ffmpeg:side_yard_sub#audio=aac"

    front_door:
       - http://192.168.5.60/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=*****$
       - "ffmpeg:front_door#audio=aac"

    front_door_sub:
      - http://192.168.5.60/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=*****$
      - "ffmpeg:front_door_sub#audio=aac"

    shed:
      - rtsp://admin:*****$@192.168.20.6:554/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:shed#video=h264#audio=aac"

    shed_sub:
      - rtsp://admin:****$@192.168.20.6:554/cam/realmonitor?channel=1&subtype=1
      - "ffmpeg:shed_sub#video=h264#audio=aac"

  shed:
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-aac
      inputs:
        - path: rtsp://127.0.0.1:8554/shed_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/shed
          input_args: preset-rtsp-restream
          roles:
            - record
    detect: 
      width: 1024
      height: 452
      fps: 5
    objects:
      track:
        - person
        - dog

Relevant log output

none

FFprobe output from your camera

??

Frigate stats

{"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.3"},"1":{"cpu":"0.0","mem":"0.0"},"114":{"cpu":"0.0","mem":"0.2"},"134":{"cpu":"0.0","mem":"0.4"},"135":{"cpu":"0.0","mem":"0.4"},"136":{"cpu":"0.0","mem":"0.4"},"144":{"cpu":"0.0","mem":"0.1"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"163":{"cpu":"0.0","mem":"0.1"},"186":{"cpu":"0.0","mem":"0.1"},"216":{"cpu":"0.0","mem":"0.1"},"2328":{"cpu":"0.0","mem":"0.0"},"2339":{"cpu":"0.0","mem":"0.0"},"2342":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"240":{"cpu":"0.0","mem":"0.1"},"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"},"29":{"cpu":"0.0","mem":"0.0"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"425":{"cpu":"0.0","mem":"1.0"},"431":{"cpu":"0.0","mem":"0.1"},"432":{"cpu":"0.0","mem":"1.3"},"434":{"cpu":"0.7","mem":"1.1"},"437":{"cpu":"0.3","mem":"1.1"},"438":{"cpu":"0.0","mem":"0.2"},"439":{"cpu":"0.7","mem":"1.1"},"440":{"cpu":"0.3","mem":"1.1"},"441":{"cpu":"0.0","mem":"0.2"},"442":{"cpu":"0.7","mem":"1.1"},"445":{"cpu":"0.3","mem":"1.1"},"448":{"cpu":"0.7","mem":"1.1"},"455":{"cpu":"1.7","mem":"0.6"},"456":{"cpu":"1.7","mem":"0.6"},"460":{"cpu":"2.0","mem":"0.3"},"462":{"cpu":"3.3","mem":"0.3"},"463":{"cpu":"0.0","mem":"0.2"},"470":{"cpu":"1.0","mem":"0.7"},"473":{"cpu":"2.7","mem":"0.3"},"474":{"cpu":"16.0","mem":"0.5"},"475":{"cpu":"147.7","mem":"2.5"},"476":{"cpu":"1.7","mem":"0.2"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"89":{"cpu":"10.7","mem":"0.3"},"97":{"cpu":"0.0","mem":"0.0"},"98":{"cpu":"2.3","mem":"2.0"},"MiB":{"cpu":"3269.4","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":2.2,"detectors":{"coral":{"detection_start":0.0,"inference_speed":25.18,"pid":432}},"front_door":{"camera_fps":5.1,"capture_pid":448,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":456,"pid":440,"process_fps":5.1,"skipped_fps":0.0},"gpu_usages":{"intel-vaapi":{"gpu":"1.05 %","mem":"- %"}},"service":{"last_updated":1690638552,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":101.6,"mount_type":"tmpfs","total":104.9,"used":3.2},"/media/frigate/clips":{"free":289732.9,"mount_type":"ext4","total":982820.9,"used":643087.9},"/media/frigate/recordings":{"free":289732.9,"mount_type":"ext4","total":982820.9,"used":643087.9},"/tmp/cache":{"free":289732.9,"mount_type":"ext4","total":982820.9,"used":643087.9}},"temperatures":{},"uptime":1036,"version":"0.12.0-da3e197"},"shed":{"camera_fps":5.1,"capture_pid":445,"detection_enabled":1,"detection_fps":1.3,"ffmpeg_pid":455,"pid":439,"process_fps":5.1,"skipped_fps":0.0},"side_yard":{"camera_fps":5.0,"capture_pid":442,"detection_enabled":1,"detection_fps":0.9,"ffmpeg_pid":470,"pid":437,"process_fps":4.6,"skipped_fps":0.0}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Empiretech IPC-Color4K-T180

Any other information that may be helpful

No response

skrashevich commented 1 year ago

try this:

    shed:
      - ffmpeg:rtsp://admin:*****$@192.168.20.6:554/cam/realmonitor?channel=1&subtype=0#video=h264
      - "ffmpeg:shed#video=h264#audio=aac"

    shed_sub:
      - ffmpeg:rtsp://admin:****$@192.168.20.6:554/cam/realmonitor?channel=1&subtype=1#video=h264
      - "ffmpeg:shed_sub#video=h264#audio=aac"

and.. are you sure about 1024x452 resolution?

UPEngineer commented 1 year ago

I tried that and it did not work. I will double check the settings for the detect stream. It is a 180 degree camera.

UPEngineer commented 1 year ago

I looked at the camera settings. The main stream is 4096 x 1800 and the sub stream is 1024 x 452.

NickM-27 commented 1 year ago

Your phone is likely unable to decode the larger stream. I would suggest setting

shed:
  ffmpeg:
    ...
  live:
    stream_name: shed_sub

so that the sub stream is used for the live view

Weird thing is if I click on debug, the live video shows just fine.

That is not weird, the debug view comes from decoded frames which is entirely different than the standard mse / webrtc live view

UPEngineer commented 1 year ago

@NickM-27 , you my friend are a lifesaver. That suggestion did the trick! Never thought about that, but since it is a much larger picture since it is 180 degree camera, it makes sense.