blakeblackshear / frigate

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

[Support]: MSE camera view failing under Firefox. #4861

Closed ashleyw-gh closed 1 year ago

ashleyw-gh commented 1 year ago

Describe the problem you are having

Just a heads up: I updated to 0.12.0-beta1, and noticed that the camera view (using mse) is not working under Firefox. On firefox I have to switch to jsmpeg, but then the resolution seems to drop to the standard detect resolution. mse works under Chrome fine. I suspect the problem is Firefox specific as there seem to be long standing issues with mse support under Firefox. (I had to add the restream role under the roles on the high resolution main stream). thanks - great work with the 0,12 beta though! It's great to see the high res real-time feed though on the camera view under Chrome!

Version

0.12.0-beta1

Frigate config file

database:
  path: /db/frigate.db
mqtt:
  host: <mqtthost>
  port: 1883
  topic_prefix: frigate
  user: <mqttuser>
  password: <mqttpassword>
detectors:
  coral1:
    type: edgetpu
    device: usb:0
  coral2:
    type: edgetpu
    device: usb:1
model:
  labelmap:
    15: animal
    16: animal
    17: animal
    18: animal
    19: animal
    20: animal
    21: animal
    22: animal
    23: animal
    24: animal
cameras:
  front:
    ffmpeg:
      inputs:
        - path: rtsp://<user:pwd>@<camerafront>:554/h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://<user:pwd>@<camerafront>:554/h264Preview_01_main
          roles:
            - record
            - rtmp
            - restream
    detect:
      width: 640
      height: 360
    record:
      enabled: True
      retain:
        days: 2
    motion:
      mask:
        - 196,0,196,26,0,27,0,0
    objects:
      filters:
        person:
          min_area: 700
          mask:
            - 230,230,352,229,353,288,235,294
      track:
        - person
        - animal
  back:
    ffmpeg:
      inputs:
        - path: rtsp://<user:pwd>@<cameraback>:554/h264Preview_01_sub
          roles:
            - detect
        - path: rtsp://<user:pwd>@<cameraback>:554/h264Preview_01_main
          roles:
            - record
            - rtmp
            - restream
    detect:
      width: 640
      height: 360
    record:
      enabled: True
      retain:
        days: 2
    motion:
      mask:
        - 490,195,489,308,558,308,606,127,565,93,499,103
        - 640,0,640,73,320,87,226,107,130,142,91,275,78,328,0,330,0,0
    objects:
      filters:
        person:
          min_area: 700
          mask:
            - 488,283,592,285,594,312,492,312
      track:
        - person
        - animal
motion:
  improve_contrast: True
record:
  enabled: True
  events:
    retain:
      default: 2
      mode: all
snapshots:
  enabled: True
  timestamp: False
  bounding_box: True
  retain:
    default: 2
birdseye:
  enabled: True
  mode: continuous

Relevant log output

not relevant.

FFprobe output from your camera

not relevant.

Frigate stats

No response

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

reolink RLC-811A

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

This should be fixed with go2rtc rc6

NickM-27 commented 1 year ago

Either way not much we can do about this directly

ashleyw-gh commented 1 year ago

great stuff, I also just see the dump of the config file from within the Frigate UI seemed to get rid of the "- restream" so I presume this is just cosmetics on the UI dump or the restream role will be removed later?

NickM-27 commented 1 year ago

I'm not sure what you mean, but the restream role just tells frigate which stream to give to go2rtc so there's no ffmpeg command for it inside frigate itself.

ashleyw-gh commented 1 year ago

sorry, my bad on the config file (I had pasted in an old config file by mistake) - I've updated it properly now. the dump of the config file from within the UI works as expected.

avico78 commented 1 year ago

I'm not sure what you mean, but the restream role just tells frigate which stream to give to go2rtc so there's no ffmpeg command for it inside frigate itself.

can u please explain about reststream in the context of go2rtc?

NickM-27 commented 1 year ago

The new restream role gives go2rtc the url to the camera stream. Go2rtc will then offer this stream to consumers. Even if multiple phones watch this stream at the same time, go2rtc is only making 1 connection to the camera itself. Frigate also uses go2rtc restream to provide the mse and WebRTC live views.

avico78 commented 1 year ago

thanks , maybe I'm confused. but is not make more sense to let go2rtc the connect and use the rstp url in frigate ? what the difference from reststream to rtmp ?

is there any plan to enable the option to use webrtc/mse stream in frigate live view ? cause for me now ,I'm using frigate as nvr , home assistant to automation based frigate and go2rtc webui url to watch cameras from outside , unfortunately webrtc not working in home assistant for me .

NickM-27 commented 1 year ago

thanks , maybe I'm confused.

but is not make more sense to let go2rtc the connect and use the rstp url in frigate ?

This use case is covered in the restream docs, this is how I use it as well

what the difference from reststream to rtmp ?

Rtmp is a different protocol, this new restream is rtsp based which is much more reliable, supports h265, and supports higher bandwidth than rtmp

is there any plan to enable the option to use webrtc/mse stream in frigate live view ?

Have you read the release notes? because that's exactly what 0.12 does and this is covered in the Live View Improvements section of the release notes

avico78 commented 1 year ago

@NickM-27 - I read the RN of 0.12 ... wow so much candies:) great work people ...amazing that u put so much in one release...

I was too curious to wait so I move all existing frigate folder a side and install it as fresh installation . As it's off topic for this one - so just want to know if it's ok to open new post in regards to beta version(currently Frigate failed to start) ?

NickM-27 commented 1 year ago

@NickM-27 - I read the RN of 0.12 ... wow so much candies:) great work people ...amazing that u put so much in one release...

I was too curious to wait so I move all existing frigate folder a side and install it as fresh installation . As it's off topic for this one - so just want to know if it's ok to open new post in regards to beta version(currently Frigate failed to start) ?

yes, please open your own issue

Flamewires commented 1 year ago

As another data point it does work for me, even with 0.12-beta1, I'm running FF 108.0.1 (64-bit) on arch linux.

NickM-27 commented 1 year ago

@Flamewires yeah it is going to be very dependent on the cameras audio / video codecs

NickM-27 commented 1 year ago

General issues discussed here should be fixed with beta2, MSE support in firefox is going to depend on firefox, feel free to create a new issue if something else comes up.

ashleyw-gh commented 1 year ago

FYI, I've switched to 0.12.0-beta2 and Firefox under Windows 11 (tested on multiple different laptops/desktops/VDIs), and MSE view still does not work. (FF 108.0.2). Strangely, on Chrome/Edge it appears to work fine on the same machines. Firefox under Android12 works fine.

blakeblackshear commented 1 year ago

@ashleyw-gh Firefox support will be very limited at best: https://deploy-preview-4055--frigate-docs.netlify.app/configuration/live#live-view-options

coledeck commented 1 year ago

MSE is working for me on Firefox on Arch Linux, just have to click anywhere in the video player to have it start playing and it automatically catches up to live. No configuration or anything, just updated to beta2 and then beta3 and it just worked.

Maybe docs could mention that it might work in certain setups for Firefox instead of a hard no?

NickM-27 commented 1 year ago

@coledeck I already created a PR to update the docs https://github.com/blakeblackshear/frigate/pull/5050

coledeck commented 1 year ago

Damn, you beat my comment by 3 minutes. You got a time machine over there?

Thanks for your dedication to this project :)