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

[Support]: H.265 Can't Stream to Web UI #5509

Closed
ccutrer opened this issue Feb 15, 2023 · 7 comments
Closed

[Support]: H.265 Can't Stream to Web UI #5509

ccutrer opened this issue Feb 15, 2023 · 7 comments
Labels
beta Related to the current beta version of frigate support triage

Comments

@ccutrer
Copy link
Contributor

ccutrer commented Feb 15, 2023

Describe the problem you are having

I have a smattering of Hikvision cameras, some H.264, some H.265. With all the H.264 cameras, I've got them setup going through go2rtc, WebRTC is set up and working, and restreaming them for Frigate. BUT, the H.265 cameras are having various issues. I have them set up to still use H.264 for the substream to reduce decoding requirements for motion and stuff, but the main stream is H.265 (with H.265+ turned OFF).

In the WebUI in Chrome, MSE and JSMPEG work just fine. WebRTC view the timer starts going, but nothing ever displays. I can't find any browser errors or problems with the web socket connections.

In Safari, MSE view will load the first frame at full resolution, but then says "error" down in the area where playback controls normally would be. Web inspector is showing continual binary messages are still coming through. The WebRTC view behaves the same as Chrome.

In Safari on iOS, MSE is not supported, and WebRTC behaves the same as the others.

There are zero errors in any of the Frigate, Go2RTC, or Nginx logs.

Version

0.12.0-27A31E7

Frigate config file

detectors:
  coral:
    type: edgetpu
    device: usb

ffmpeg:
  hwaccel_args: preset-vaapi

ui:
  live_mode: webrtc
  use_experimental: false

go2rtc:
  streams:
    pantry: rtsp://admin:secret@192.168.x.x/Streaming/Channels/101
    pantry_sub: rtsp://admin:secret@192.168.x.x/Streaming/Channels/102
  webrtc:
    candidates:
      - frigate.x.network:8555
      - 192.168.x.x:8555

detect:
  fps: 6
  max_disappeared: 18
  stationary:
    interval: 12

objects:
  track:
    - person
    - dog
    - cat

cameras:
  pantry:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/pantry?video=copy&audio=copy
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
        - path: rtsp://127.0.0.1:8554/pantry_sub?video=copy&audio=copy
          input_args: preset-rtsp-restream-low-latency
          roles:
            - detect
    record:
      enabled: true
    rtmp:
      enabled: false
    detect:
      width: 640
      height: 360
    motion:
      mask:
        - 28,26,234,26,234,35,28,35 # timestamp
    zones:
      mud_zone:
        coordinates: 492,0,395,0,337,146,397,193
      pantry_zone:
        coordinates: 455,251,296,360,194,360,82,134,277,59
    snapshots:
      enabled: true
    objects:
      filters:
        person:
          min_area: 3350
          mask:
            - 291,360,486,176,533,214,415,360

Relevant log output

Nothing relevant.

FFprobe output from your camera

[ { "return_code": 0, "stderr": {}, "stdout": { "programs": [], "streams": [ { "avg_frame_rate": "15/1", "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)", "display_aspect_ratio": "16:9", "height": 2160, "width": 3840 }, { "avg_frame_rate": "0/0", "bit_rate": "64000", "codec_long_name": "PCM mu-law / G.711 mu-law" } ] } }, { "return_code": 0, "stderr": {}, "stdout": { "programs": [], "streams": [ { "avg_frame_rate": "6/1", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "display_aspect_ratio": "16:9", "height": 360, "width": 640 } ] } } ]

Frigate stats

{"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.9"},"1":{"cpu":"0.0","mem":"0.0"},"458":{"cpu":"0.7","mem":"0.7"},"585":{"cpu":"1.7","mem":"0.4"}},"pantry":{"camera_fps":6.0,"capture_pid":562,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":585,"pid":458,"process_fps":6.0,"skipped_fps":0.0}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Hikvision DS-2CD2183G0-IU 2.8mm

Any other information that may be helpful

Events are detected, and the recorded clips record and play back just fine.

@NickM-27 NickM-27 added the beta Related to the current beta version of frigate label Feb 15, 2023
@NickM-27
Copy link
Collaborator

NickM-27 commented Feb 15, 2023

@ccutrer
Copy link
Contributor Author

ccutrer commented Feb 16, 2023

Your second link explicitly has H265 (with an asterisk) in the WebRTC/Desktop Safari cell. I can't find the explicit thing that asterisk points to though. Maybe AlexxIT/Blog#5 ? I'm assuming my stream doesn't exactly match those formatting requirements then? Is that something Go2RTC/Frigate can correct, or does it have to come in the exact right format straight from the camera?

Okay, what about my error with MSE in Safari?

@NickM-27
Copy link
Collaborator

Your second link explicitly has H265 (with an asterisk) in the WebRTC/Desktop Safari cell. I can't find the explicit thing that asterisk points to though. Maybe AlexxIT/Blog#5 ? I'm assuming my stream doesn't exactly match those formatting requirements then? Is that something Go2RTC/Frigate can correct, or does it have to come in the exact right format straight from the camera?

It is right below the chart, you have to enable it

Screen Shot 2023-02-15 at 17 05 00 PM

Okay, what about my error with MSE in Safari?

Not sure, probably some safari specific issue. Might want to try the go2rtc dashboard to play and see if it behaves the same

@ccutrer
Copy link
Contributor Author

ccutrer commented Feb 16, 2023

Ahhh, there we go. I didn't realize it was still an experimental feature that had to be enabled. The Chrome links all just say "it's done, and in Chrome 107".

Btw, @NickM-27 I appreciate your help today. I hope I'm not being tooo annoying ;).

@ccutrer ccutrer closed this as completed Feb 16, 2023
@NickM-27
Copy link
Collaborator

Ahhh, there we go. I didn't realize it was still an experimental feature that had to be enabled. The Chrome links all just say "it's done, and in Chrome 107".

Yeah, it really is "codec madness" lol

Btw, @NickM-27 I appreciate your help today. I hope I'm not being tooo annoying ;).

I am always happy to help

@AnonymousWebHacker
Copy link

Chromium + HEVC support (windows+linux) https://github.com/StaZhu/enable-chromium-hevc-hardware-decoding/releases

For android, just i try browsers moderns, and work (if your device mobil have hevc hardware support)

@AnonymousWebHacker
Copy link

AnonymousWebHacker commented Dec 24, 2023

@NickM-27 I think it would be interesting to make a desktop app with integrated MPV, so that Frigate has full support with hevc videos and avoids recoding to h264 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Related to the current beta version of frigate support triage
Projects
None yet
Development

No branches or pull requests

3 participants