blakeblackshear / frigate-hass-integration

Frigate integration for Home Assistant
MIT License
739 stars 116 forks source link

Cannot play media, but can browse the folder and open snapshot #219

Closed bsr203 closed 2 years ago

bsr203 commented 2 years ago

Hello, installed Frigate through Docker and everything seems to work.

version: "3.8"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
    shm_size: "64mb" # update for your cameras based on calculation above
    devices:
      # - /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      # - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/frigate.yml:/config/config.yml:ro
      - /media/footage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935" # RTMP feeds
    environment:
      FRIGATE_RTSP_PASSWORD: "xyz"

Frigate is available at 192.168.1.2:5000

Configured the HA integration and looks everything good

Screen Shot 2022-02-17 at 10 17 32 AM

I see the media (clips, recording etc) through HA

Screen Shot 2022-02-17 at 10 18 45 AM Screen Shot 2022-02-17 at 10 18 56 AM Screen Shot 2022-02-17 at 10 19 13 AM

When try to play clips/recordings, I get error (Snapshot/png loads fine)

Screen Shot 2022-02-17 at 10 19 33 AM

This is the details of the error from browser

Request URL: http://192.168.1.3:8123/api/frigate/frigate/vod/event/1645108206.040023-wqz43m/init-v1.mp4?authSig=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZWI5M2ZhMGM4NmE0NGI0YTg0MDFhMTIyOGJjN2FjZCIsInBhdGgiOiIvYXBpL2ZyaWdhdGUvZnJpZ2F0ZS92b2QvZXZlbnQvMTY0NTEwODIwNi4wNDAwMjMtd3F6NDNtL2luZGV4Lm0zdTgiLCJpYXQiOjE2NDUxMTExNjEsImV4cCI6MTY0NTE5NzU2MX0.5caBTa-nsCVdnZmcQDFlaZZdlDN6Yhi-fL_DuM55sag
Request Method: GET
Status Code: 404 Not Found
Remote Address: 192.168.1.3:8123
Referrer Policy: strict-origin-when-cross-origin
Content-Length: 14
Content-Type: text/plain; charset=utf-8
Date: Thu, 17 Feb 2022 15:19:57 GMT
Server: Python/3.9 aiohttp/3.8.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cache-Control: max-age=0
Connection: keep-alive
Host: 192.168.1.3:8123
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4880.0 Safari/537.36

This is same with Safari/Firefox/Chrome.

I see frigate repeats in the url, (http://192.168.1.3:8123/api/frigate/frigate/vod) is it normal??

i see a similar issue at https://github.com/blakeblackshear/frigate/issues/1830 and https://github.com/blakeblackshear/frigate/issues/1534 . I am not sure mine is same as I don't have synology. This is the permission I see in the docker container

$ ls -l media/
total 4
drwxr-xr-x 5 root root 4096 Feb 17 09:59 footage

bsr@automation /media/footage/recordings/2022-02/17/00/coop_back
$ ls -l
total 1374468
-rw-r--r-- 1 root root 3963466 Feb 17 00:00 00.09.mp4
-rw-r--r-- 1 root root 3875609 Feb 17 00:00 00.19.mp4

Please let me know any other info needed. I tried everything today so should be latest versions.

dermotduffy commented 2 years ago

I see frigate repeats in the url, (http://192.168.1.3:8123/api/frigate/frigate/vod) is it normal??

Yes.

Are you seeing anything interesting in your Javascript console when you open the HA media browser? This is suggestive of a video or network error somewhere between your browser <-> HA <-> Frigate (video fragment is failing to load in the player). I think it's unlikely the issue is actually the integration (this repo).

Do the clips play correctly from the frigate UI? (Not HA)

bsr203 commented 2 years ago

https://user-images.githubusercontent.com/1966521/157152036-96bda8e5-397d-4aad-9370-e385372b2e1d.mov

yes, it is working from Frigate UI. Please see the video.

As you see I only see below error

http://192.168.1.3:8123/api/frigate/frigate/vod/event/1646689487.29286-33znz0/init-v1.mp4?authSig=eyJ0eXAiOiJKV1QiLC... 

in the console. above is when plating clips, but same is for recording too.

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (init-v1.mp4, line 0)

Please let me know for any other details.

dermotduffy commented 2 years ago

Hmm. Looks like an issue with the Frigate backend (it is not returning the video fragments that the player expects). What version of Frigate backend are you using?

bsr203 commented 2 years ago

In the UI DEBUG 0.9.4-26AE608

This is the docker compose file I use

version: "3.8"
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
  ....

Everything should be latest as I just set it up.

Thank you for your time.

dermotduffy commented 2 years ago

Foundational suggestion would be to try upgrading your Frigate instance: https://github.com/blakeblackshear/frigate/releases

... and see if the issue persists.

bsr203 commented 2 years ago

Hi. I updated both frigate and integration plugin.

Version shows: DEBUG 0.10.0-BFECEE9

Still the same error.

I don't see anything in nginx log when the api call fails, so may be failing before. hope @blakeblackshear will chime in.

Thanks again for your time.

blakeblackshear commented 2 years ago

Frigate's frontend uses the exact same endpoint for playback, so I am not sure why it would work in one place vs the other. You can try looking at the nginx logs in the frigate container at /usr/local/nginx/logs/error.log.

bsr203 commented 2 years ago

There is no error message in the nginx log, or homeassistant. When refresh the clips, I see this warning

2022/03/10 10:35:10 [warn] 204#204: *17368 an upstream response is buffered to a temporary file /usr/local/nginx/proxy_temp/7/00/0000000007 while reading upstream, client: 192.168.1.3, server: , request: "GET /api/events?limit=50&has_clip=1 HTTP/1.1", upstream: "http://127.0.0.1:5001/events?limit=50&has_clip=1", host: "192.168.1.2:5000"

The only difference between the API calls from firgate UI and HA is the addition of auth signature. Just providing the difference and failing request again if you see something unusual.

Success: Frigate UI


#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-VERSION:6
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-MAP:URI="init-v1.mp4"
#EXTINF:10.000,
seg-1-v1.m4s
#EXTINF:10.000,
seg-2-v1.m4s
#EXTINF:10.000,
seg-3-v1.m4s
#EXTINF:10.000,
seg-4-v1.m4s
#EXTINF:10.000,
seg-5-v1.m4s
#EXTINF:10.000,
seg-6-v1.m4s
#EXTINF:10.000,
seg-7-v1.m4s
#EXTINF:2.044,
seg-8-v1.m4s
#EXT-X-ENDLIST
Summary
URL: http://192.168.1.2:5000/vod/event/1646926353.470736-bt3hip/seg-1-v1.m4s
Status: 200 OK
Source: Network
Address: 192.168.1.2:5000

Request
GET /vod/event/1646926353.470736-bt3hip/seg-1-v1.m4s HTTP/1.1
Accept: */*
Connection: Keep-Alive
Host: 192.168.1.2:5000
Accept-Language: en-us
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Referer: http://192.168.1.2:5000/events
Accept-Encoding: identity
X-Playback-Session-Id: 60AEF60A-7FF6-4488-8EED-ABB3CB000DF5

Response
HTTP/1.1 200 OK
Content-Type: video/mp4
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, HEAD, OPTIONS
Access-Control-Expose-Headers: Server,range,Content-Length,Content-Range
Expires: Thu, 10 Mar 2022 15:44:39 GMT
Access-Control-Allow-Headers: *
Cache-Control: no-cache
Date: Thu, 10 Mar 2022 15:44:40 GMT
Content-Length: 3922546
Connection: keep-alive
ETag: "-1-3bda72"
Accept-Ranges: bytes
Last-Modified: Sun, 19 Nov 2000 08:52:00 GMT
Server: nginx/1.18.0

failing: (HA)

#EXTM3U
#EXT-X-TARGETDURATION:10
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-V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My40NzA3MzYtYnQzaGlwL2luZGV4Lm0zdTgiLCJpYXQiOjE2NDY5MjcwOTQsImV4cCI6MTY0NzAxMZQ5NH0.DyV3qK31kUaWo7rZpAETi4ZDoIZMdw6_DKEYuRWcGP4
Status: 404 Not Found
Source: Network
Address: 192.168.1.3:8123
Initiator: 
635a930d.js:1:217523

Request
GET /api/frigate/frigate/vod/event/1646926353.470736-bt3hip/init-v1.mp4 HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Host: 192.168.1.3:8123
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
Accept-Language: en-us
Referer: http://192.168.1.3:8123/media-browser/browser/app%2Cmedia-source%3A%2F%2Ffrigate/video%2Cmedia-source%3A%2F%2Ffrigate%2Ffrigate%2Fevent-search%2Fclips%2F%2F%2F%2F%2F%2F
Connection: keep-alive

Response
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Content-Length: 14
Date: Thu, 10 Mar 2022 15:44:54 GMT
Server: Python/3.9 aiohttp/3.8.1

Query String Parameters
authSig: eyJ0eXAiOiJKV1QiLCJhbGciOiiIUzI1NiJ9.eyJpc3MiOiJjMTUxOWQwY2RmZjc0MmIxYmMxYzBmMTkxMmRlNDkyNSIsInBhdGgiOiIvYXBpL2ZyaWdhdGUvZnJpZ2F0ZS92b2QvZXZlbnQvMTY0NjkyNjM1My40NzA3MzYtYnQzaGlwL2luZGV4Lm0zdTgiLCJpYXQiOjE2NDY5MjcwOTQsImV4cCI6MTY0NzAxMZQ5NH0.DyV3qK31kUaWo7rZpAETi4ZDoIZMdw6_DKEYuRWcGP4
dermotduffy commented 2 years ago

The only difference between the API calls from firgate UI and HA is the addition of auth signature.

That authSig is not actually needed by the Frigate backend, it's the HA authSig (so we could strip it from the HA outbound request and things should be fine).

=> If you manually remove the authSig from a failing request URL and try to manually fetch it, what happens?

blakeblackshear commented 2 years ago

@dermotduffy Something looked off here and I realized that the endpoint is mp4/m4s. The view is expecting .ts files.

blakeblackshear commented 2 years ago

@bsr203 can you post the ffprobe output from your stream or a screenshot of the VLC codec info?

bsr203 commented 2 years ago

Edit: I may be using ffprobe input incorrectly, please see the end of next response.

Sorry for the delay.

I can open the rtps stream by VLC (installed in my mac) with the URL (rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0). And the codec info.

Screen Shot 2022-03-14 at 12 27 55 PM
ffprobe  rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0
[2] 267009
[1]   Exit 1                  ffprobe rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1
root@27b7b00debbd:/opt/frigate# ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x56437e8efb80] method DESCRIBE failed: 404 Not Found
rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1: Server returned 404 Not Found

This is an amcrest camera, and the settings

Screen Shot 2022-03-14 at 12 38 45 PM

I could open the substream, which is H264, but ffprobe gives the same error.

Screen Shot 2022-03-14 at 12 35 30 PM
ffprobe rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=1 
[3] 267878
[2]   Exit 1                  ffprobe rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1
root@27b7b00debbd:/opt/frigate# ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x55b91871bb80] method DESCRIBE failed: 404 Not Found
rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1: Server returned 404 Not Found

in the error, looks like it is not considering the query parameter subtype, or I could be wrong in my assumption how sub stream works.

bsr203 commented 2 years ago

Also, I changed the main stream to H264.

image

ffprobe gives the same error.

root@27b7b00debbd:/opt/frigate# ffprobe  rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0
[5] 269494
[4]   Exit 1                  ffprobe rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1
root@27b7b00debbd:/opt/frigate# ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x55f77bd19b80] method DESCRIBE failed: 404 Not Found
rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1: Server returned 404 Not Found

EDIT:

I may be using ffprobe input wrongly. With quoted url, I get this.

ffprobe  "rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0"
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.128000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 7713:7712 DAR 857:482], 15 fps, 100 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: aac, 8000 Hz, mono, fltp
[6]+  Exit 1                  ffprobe rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1
root@27b7b00debbd:/opt/frigate# 

it gives different output as I repeat the same command.

root@27b7b00debbd:/opt/frigate# ffprobe  "rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0"
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x558633340b80] max delay reached. need to consume packet
[rtsp @ 0x558633340b80] RTP: missed 289 packets
[h264 @ 0x558633344dc0] error while decoding MB 164 66, bytestream -12
[h264 @ 0x558633344dc0] concealing 16445 DC, 16445 AC, 16445 MV errors in I frame
Input #0, rtsp, from 'rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.129000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 7713:7712 DAR 857:482], 15 fps, 100 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: aac, 8000 Hz, mono, fltp

root@27b7b00debbd:/opt/frigate# ffprobe  "rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0"
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[rtsp @ 0x55ce558d5b80] max delay reached. need to consume packet
[rtsp @ 0x55ce558d5b80] RTP: missed 335 packets
[rtsp @ 0x55ce558d5b80] max delay reached. need to consume packet
[rtsp @ 0x55ce558d5b80] RTP: missed 57 packets
Input #0, rtsp, from 'rtsp://admin:pwd@192.168.1.203:554/cam/realmonitor?channel=1&subtype=0':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.129000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, bt709, progressive), 3840x2160 [SAR 7713:7712 DAR 857:482], 15 fps, 100 tbr, 90k tbn, 30 tbc
    Stream #0:1: Audio: aac, 8000 Hz, mono, fltp
blakeblackshear commented 2 years ago

@bsr203 can you switch your streams to H264? The change in the extension is causing the proxy in the integration to fail.

bsr203 commented 2 years ago

@blakeblackshear thank you for your help on this. Sorry to confuse you with lot of noise above, but everything in the last comment is after I switch to H264. see Also, I changed the main stream to H264.

Edit:

you are right. The new clips which recorded after switching to H264 is working great. Great we could narrow it down. I saw few issues about H265 support. Does it mean H265 won't be supported in UI and should I switch to H264. My only reason to use H265 is to reduce bandwidth usage in case multiple cameras cause bottleneck. I didn't observe any issue and open to switch to H264 if that's not the case. Thanks again for you time supporting me.

blakeblackshear commented 2 years ago

H265 only works in a few browsers and even then only sometimes. Many users can't get it to play at all. I am not sure what is different about your streams. For the integration, H265 results in different formats for streaming which don't work at all. This can be fixed, but there are other downsides to H265 as well.

bsr203 commented 2 years ago

Thanks for your help. I can wait till H265 fully supported by browsers, and H264 is working fine till then. Thanks .

blakeblackshear commented 2 years ago

I can wait till H265 fully supported by browsers

FYI, I don't think anyone is expecting this to ever happen.