Reolink Duo 2 incompatible due to aspect ratio and h265 encoding
I am having trouble configuring a Reolink Duo 2 from what seems to be a combination of the aspect ratio and the h265 encoding. This camera main stream and its sub stream have a strange aspect ratio due to the cameras 180 degree FOV achieveable with feeds from two lenses stiched together on device.
For the record I use Frigate's wrapped go2rtc which is at version 1.9.2 I can also tell Frigate is not contributing to the issue because when i access the stream on 1984 (directly to go2rtc) and click "streams" this is where i see the failure to load the stream and perform my testing.
My camera config:
I have also set them to constant bit rate and constant frame rate to reduce variables
ffprobe on Clear stream:
root@eschaton:/opt# ffprobe rtsp://admin:[email protected]:554/h265Preview_01_main
ffprobe version N-108879-gcb803a0072 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared
libavutil 57. 39.101 / 57. 39.101
libavcodec 59. 51.100 / 59. 51.100
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 49.101 / 8. 49.101
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
Input #0, rtsp, from 'rtsp://admin:[email protected]:554/h265Preview_01_main':
Metadata:
title : Session streamed by "preview"
Duration: N/A, start: 0.008875, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 4608x1728, 20 fps, 90k tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
ffprobe on Fluent stream:
root@eschaton:/opt# ffprobe rtsp://admin:[email protected]:554/h264Preview_01_sub
ffprobe version N-108879-gcb803a0072 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared
libavutil 57. 39.101 / 57. 39.101
libavcodec 59. 51.100 / 59. 51.100
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 49.101 / 8. 49.101
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
Input #0, rtsp, from 'rtsp://admin:[email protected]:554/h264Preview_01_sub':
Metadata:
title : Session streamed by "preview"
Duration: N/A, start: 0.000563, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1536x576, 10 fps, 10 tbr, 90k tbn
Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
go2rtc config (within frigate):
ffmpeg:
hwaccel_args: preset-nvidia
go2rtc:
log:
level: trace
api: trace
exec: trace
ngrok: trace
rtsp: trace
streams: trace
webrtc: trace
webrtc:
listen: :8555
candidates:
- 192.168.1.50:8555
- stun:8555
streams:
# Reolinks
front:
- rtsp://admin:[email protected]:554/h265Preview_01_main
front_sub:
- rtsp://admin:[email protected]:554/h264Preview_01_sub
I can tell that MSE mode is being used and that is acceptable for my use case. From what I have read h265 will use MSE. This works for a while but fails an an arbitrary time in the future. Eventually go2rtc seems to reject it as a viable stream probably due to #1634 however wrapping the stream in ffmpeg does not help either the stream flickers and generates artifacts.
The substream does work with RTC as its probably h264
I have tried using ffmpeg and re-encoding teh stream to h264 but the aspect ratio makes this not possible. So the stream has to stay in h265 Config:
front:
- ffmpeg:rtsp://admin:[email protected]:554/Preview_01_main#video=h264#hardware=cuda
Log:
2025-04-23 11:30:36.740608447 11:30:36.740 TRC [streams] dial cons=0 prod=0 error="exec: Input #0, rtsp, from 'rtsp://admin:[email protected]:554/Preview_01_main':\n Metadata:\n title : Session streamed by \"preview\"\n Duration: N/A, start: 0.211378, bitrate: N/A\n Stream #0:0: Video: hevc (Main), yuv420p(tv), 4608x1728, 20 fps, 20 tbr, 90k tbn\nStream mapping:\n Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_nvenc))\nPress [q] to stop, [?] for help\n[hevc @ 0x558d3b8220c0] Could not find ref with POC 21\n[h264_nvenc @ 0x558d3b81edc0] Width 4608 exceeds 4096\n[h264_nvenc @ ..."
2025-04-23 11:30:36.740628778 11:30:36.740 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
2025-04-23 11:30:36.740630797 11:30:36.740 TRC [streams] skip cons=0 prod=0
2025-04-23 11:30:36.740632727 11:30:36.740 TRC [streams] skip stop none producer
2025-04-23 11:30:36.740669928 11:30:36.740 WRN [rtsp] error="streams: exec: Input #0, rtsp, from 'rtsp://admin:[email protected]:554/Preview_01_main':\n Metadata:\n title : Session streamed by \"preview\"\n Duration: N/A, start: 0.211378, bitrate: N/A\n Stream #0:0: Video: hevc (Main), yuv420p(tv), 4608x1728, 20 fps, 20 tbr, 90k tbn\nStream mapping:\n Stream #0:0 -> #0:0 (hevc (native) -> h264 (h264_nvenc))\nPress [q] to stop, [?] for help\n[hevc @ 0x558d3b8220c0] Could not find ref with POC 21\n[h264_nvenc @ 0x558d3b81edc0] Width 4608 exceeds 4096\n[h264_nvenc @ ..." stream=front
When the stream eventually breaks i reload the stream hosted on go2rtc (http://192.168.1.50:1984/stream.html?src=front) and this is the trace log:
2025-04-23 12:48:36.194433549 12:48:36.194 TRC [api] GET /stream.html?src=front 192.168.1.5:55678
2025-04-23 12:48:36.200846104 12:48:36.200 TRC github.com/AlexxIT/go2rtc/internal/api/ws/ws.go:124 > error="websocket: close 1001 (going away)"
2025-04-23 12:48:36.223428894 12:48:36.223 TRC [api] GET /video-stream.js 192.168.1.5:55678
2025-04-23 12:48:36.316743109 12:48:36.316 TRC [api] GET /video-rtc.js 192.168.1.5:55678
2025-04-23 12:48:36.323505271 12:48:36.323 TRC [api] GET /api/ws?src=front 192.168.1.5:55693
2025-04-23 12:48:36.386263622 12:48:36.386 TRC [api] ws msg type=mse
2025-04-23 12:48:36.386319879 12:48:36.386 TRC [mp4] new WS/MSE consumer codecs=avc1.640029,avc1.64002A,avc1.640033,hvc1.1.6.L153.B0,mp4a.40.2,mp4a.40.5,flac,opus
2025-04-23 12:48:36.386353036 12:48:36.386 TRC [streams] check cons=0 media=video, sendonly, H264, H265
2025-04-23 12:48:36.386363698 12:48:36.386 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265
2025-04-23 12:48:36.386376796 12:48:36.386 TRC [streams] match cons=0 <= prod=0
2025-04-23 12:48:36.386460738 12:48:36.386 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML, OPUS
2025-04-23 12:48:36.386476831 12:48:36.386 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265
2025-04-23 12:48:36.386488897 12:48:36.386 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/16000
2025-04-23 12:48:36.386504037 12:48:36.386 TRC [streams] match cons=0 <= prod=0
2025-04-23 12:48:36.386898230 12:48:36.386 TRC [api] ws msg type=webrtc/offer
2025-04-23 12:48:36.386972504 12:48:36.386 DBG [webrtc] new consumer src=front
2025-04-23 12:48:36.387628767 12:48:36.387 TRC [webrtc] offer:
2025-04-23 12:48:36.387631629 v=0
2025-04-23 12:48:36.387633690 o=- 8333614879357359817 2 IN IP4 127.0.0.1
2025-04-23 12:48:36.387635420 s=-
2025-04-23 12:48:36.387637024 t=0 0
2025-04-23 12:48:36.387638694 a=group:BUNDLE 0 1
2025-04-23 12:48:36.387640334 a=extmap-allow-mixed
2025-04-23 12:48:36.387642029 a=msid-semantic: WMS
2025-04-23 12:48:36.387644462 m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 35 36 37 38 103 104 107 108 109 114 115 116 117 118 39 40 41 42 43 44 45 46 47 48 119 120 121 122 123 124 125 49
2025-04-23 12:48:36.387646077 c=IN IP4 0.0.0.0
2025-04-23 12:48:36.387647717 a=rtcp:9 IN IP4 0.0.0.0
2025-04-23 12:48:36.387649305 a=ice-ufrag:jbyJ
2025-04-23 12:48:36.387650923 a=ice-pwd:7y0HZQIJ+z1ugPPVGhTXEbZX
2025-04-23 12:48:36.387652508 a=ice-options:trickle
2025-04-23 12:48:36.387654735 a=fingerprint:sha-256 3E:03:03:0D:85:76:46:06:18:E7:48:B7:21:37:FA:10:C6:FD:A9:1E:FC:D8:AD:4B:03:FC:4C:CD:69:4C:FD:48
2025-04-23 12:48:36.387656401 a=setup:actpass
2025-04-23 12:48:36.387657917 a=mid:0
2025-04-23 12:48:36.387659608 a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
2025-04-23 12:48:36.387661481 a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
2025-04-23 12:48:36.387663217 a=extmap:3 urn:3gpp:video-orientation
2025-04-23 12:48:36.387665135 a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
2025-04-23 12:48:36.387667033 a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
2025-04-23 12:48:36.387668968 a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
2025-04-23 12:48:36.387670933 a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
2025-04-23 12:48:36.387672841 a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
2025-04-23 12:48:36.387674575 a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
2025-04-23 12:48:36.387676453 a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
2025-04-23 12:48:36.387678315 a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
2025-04-23 12:48:36.387679888 a=recvonly
2025-04-23 12:48:36.387681428 a=rtcp-mux
2025-04-23 12:48:36.387682975 a=rtcp-rsize
2025-04-23 12:48:36.387684708 a=rtpmap:96 VP8/90000
2025-04-23 12:48:36.387686308 a=rtcp-fb:96 goog-remb
2025-04-23 12:48:36.387687929 a=rtcp-fb:96 transport-cc
2025-04-23 12:48:36.387689569 a=rtcp-fb:96 ccm fir
2025-04-23 12:48:36.387691126 a=rtcp-fb:96 nack
2025-04-23 12:48:36.387692739 a=rtcp-fb:96 nack pli
2025-04-23 12:48:36.387694308 a=rtpmap:97 rtx/90000
2025-04-23 12:48:36.387695829 a=fmtp:97 apt=96
2025-04-23 12:48:36.387697434 a=rtpmap:98 VP9/90000
2025-04-23 12:48:36.387699024 a=rtcp-fb:98 goog-remb
2025-04-23 12:48:36.387700626 a=rtcp-fb:98 transport-cc
2025-04-23 12:48:36.387702162 a=rtcp-fb:98 ccm fir
2025-04-23 12:48:36.387703784 a=rtcp-fb:98 nack
2025-04-23 12:48:36.387705380 a=rtcp-fb:98 nack pli
2025-04-23 12:48:36.387706947 a=fmtp:98 profile-id=0
2025-04-23 12:48:36.387708636 a=rtpmap:99 rtx/90000
2025-04-23 12:48:36.387710134 a=fmtp:99 apt=98
2025-04-23 12:48:36.387711739 a=rtpmap:100 VP9/90000
2025-04-23 12:48:36.387713402 a=rtcp-fb:100 goog-remb
2025-04-23 12:48:36.387715007 a=rtcp-fb:100 transport-cc
2025-04-23 12:48:36.387716602 a=rtcp-fb:100 ccm fir
2025-04-23 12:48:36.387718152 a=rtcp-fb:100 nack
2025-04-23 12:48:36.387719742 a=rtcp-fb:100 nack pli
2025-04-23 12:48:36.387721367 a=fmtp:100 profile-id=2
2025-04-23 12:48:36.387722967 a=rtpmap:101 rtx/90000
2025-04-23 12:48:36.387724509 a=fmtp:101 apt=100
2025-04-23 12:48:36.387726075 a=rtpmap:35 VP9/90000
2025-04-23 12:48:36.387727583 a=rtcp-fb:35 goog-remb
2025-04-23 12:48:36.387729143 a=rtcp-fb:35 transport-cc
2025-04-23 12:48:36.387730787 a=rtcp-fb:35 ccm fir
2025-04-23 12:48:36.387732338 a=rtcp-fb:35 nack
2025-04-23 12:48:36.387733928 a=rtcp-fb:35 nack pli
2025-04-23 12:48:36.387735507 a=fmtp:35 profile-id=1
2025-04-23 12:48:36.387737082 a=rtpmap:36 rtx/90000
2025-04-23 12:48:36.387738600 a=fmtp:36 apt=35
2025-04-23 12:48:36.387740218 a=rtpmap:37 VP9/90000
2025-04-23 12:48:36.387741790 a=rtcp-fb:37 goog-remb
2025-04-23 12:48:36.387743367 a=rtcp-fb:37 transport-cc
2025-04-23 12:48:36.387744907 a=rtcp-fb:37 ccm fir
2025-04-23 12:48:36.387746485 a=rtcp-fb:37 nack
2025-04-23 12:48:36.387748065 a=rtcp-fb:37 nack pli
2025-04-23 12:48:36.387749635 a=fmtp:37 profile-id=3
2025-04-23 12:48:36.387751233 a=rtpmap:38 rtx/90000
2025-04-23 12:48:36.387752745 a=fmtp:38 apt=37
2025-04-23 12:48:36.387754335 a=rtpmap:103 H264/90000
2025-04-23 12:48:36.387755946 a=rtcp-fb:103 goog-remb
2025-04-23 12:48:36.387757511 a=rtcp-fb:103 transport-cc
2025-04-23 12:48:36.387759099 a=rtcp-fb:103 ccm fir
2025-04-23 12:48:36.387760610 a=rtcp-fb:103 nack
2025-04-23 12:48:36.387762158 a=rtcp-fb:103 nack pli
2025-04-23 12:48:36.387764059 a=fmtp:103 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
2025-04-23 12:48:36.387765595 a=rtpmap:104 rtx/90000
2025-04-23 12:48:36.387767124 a=fmtp:104 apt=103
2025-04-23 12:48:36.387768691 a=rtpmap:107 H264/90000
2025-04-23 12:48:36.387770269 a=rtcp-fb:107 goog-remb
2025-04-23 12:48:36.387771839 a=rtcp-fb:107 transport-cc
2025-04-23 12:48:36.387773406 a=rtcp-fb:107 ccm fir
2025-04-23 12:48:36.387783891 a=rtcp-fb:107 nack
2025-04-23 12:48:36.387785241 a=rtcp-fb:107 nack pli
2025-04-23 12:48:36.387786873 a=fmtp:107 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
2025-04-23 12:48:36.387788150 a=rtpmap:108 rtx/90000
2025-04-23 12:48:36.387789443 a=fmtp:108 apt=107
2025-04-23 12:48:36.387790770 a=rtpmap:109 H264/90000
2025-04-23 12:48:36.387792108 a=rtcp-fb:109 goog-remb
2025-04-23 12:48:36.387793444 a=rtcp-fb:109 transport-cc
2025-04-23 12:48:36.387794813 a=rtcp-fb:109 ccm fir
2025-04-23 12:48:36.387796080 a=rtcp-fb:109 nack
2025-04-23 12:48:36.387797424 a=rtcp-fb:109 nack pli
2025-04-23 12:48:36.387799013 a=fmtp:109 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
2025-04-23 12:48:36.387800323 a=rtpmap:114 rtx/90000
2025-04-23 12:48:36.387801633 a=fmtp:114 apt=109
2025-04-23 12:48:36.387802951 a=rtpmap:115 H264/90000
2025-04-23 12:48:36.387804338 a=rtcp-fb:115 goog-remb
2025-04-23 12:48:36.387805671 a=rtcp-fb:115 transport-cc
2025-04-23 12:48:36.387807031 a=rtcp-fb:115 ccm fir
2025-04-23 12:48:36.387808327 a=rtcp-fb:115 nack
2025-04-23 12:48:36.387809675 a=rtcp-fb:115 nack pli
2025-04-23 12:48:36.387811312 a=fmtp:115 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
2025-04-23 12:48:36.387812635 a=rtpmap:116 rtx/90000
2025-04-23 12:48:36.387813934 a=fmtp:116 apt=115
2025-04-23 12:48:36.387815228 a=rtpmap:117 H264/90000
2025-04-23 12:48:36.387816541 a=rtcp-fb:117 goog-remb
2025-04-23 12:48:36.387817828 a=rtcp-fb:117 transport-cc
2025-04-23 12:48:36.387819131 a=rtcp-fb:117 ccm fir
2025-04-23 12:48:36.387820412 a=rtcp-fb:117 nack
2025-04-23 12:48:36.387821732 a=rtcp-fb:117 nack pli
2025-04-23 12:48:36.387823326 a=fmtp:117 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
2025-04-23 12:48:36.387824658 a=rtpmap:118 rtx/90000
2025-04-23 12:48:36.387825966 a=fmtp:118 apt=117
2025-04-23 12:48:36.387827255 a=rtpmap:39 H264/90000
2025-04-23 12:48:36.387828559 a=rtcp-fb:39 goog-remb
2025-04-23 12:48:36.387829916 a=rtcp-fb:39 transport-cc
2025-04-23 12:48:36.387831268 a=rtcp-fb:39 ccm fir
2025-04-23 12:48:36.387832578 a=rtcp-fb:39 nack
2025-04-23 12:48:36.387833895 a=rtcp-fb:39 nack pli
2025-04-23 12:48:36.387835499 a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
2025-04-23 12:48:36.387836842 a=rtpmap:40 rtx/90000
2025-04-23 12:48:36.387838099 a=fmtp:40 apt=39
2025-04-23 12:48:36.387839509 a=rtpmap:41 H264/90000
2025-04-23 12:48:36.387840853 a=rtcp-fb:41 goog-remb
2025-04-23 12:48:36.387842275 a=rtcp-fb:41 transport-cc
2025-04-23 12:48:36.387843676 a=rtcp-fb:41 ccm fir
2025-04-23 12:48:36.387845012 a=rtcp-fb:41 nack
2025-04-23 12:48:36.387846367 a=rtcp-fb:41 nack pli
2025-04-23 12:48:36.387848014 a=fmtp:41 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001f
2025-04-23 12:48:36.387849454 a=rtpmap:42 rtx/90000
2025-04-23 12:48:36.387850770 a=fmtp:42 apt=41
2025-04-23 12:48:36.387852079 a=rtpmap:43 H264/90000
2025-04-23 12:48:36.387853473 a=rtcp-fb:43 goog-remb
2025-04-23 12:48:36.387863790 a=rtcp-fb:43 transport-cc
2025-04-23 12:48:36.387865137 a=rtcp-fb:43 ccm fir
2025-04-23 12:48:36.387866433 a=rtcp-fb:43 nack
2025-04-23 12:48:36.387867684 a=rtcp-fb:43 nack pli
2025-04-23 12:48:36.387869230 a=fmtp:43 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001f
2025-04-23 12:48:36.387870514 a=rtpmap:44 rtx/90000
2025-04-23 12:48:36.387871773 a=fmtp:44 apt=43
2025-04-23 12:48:36.387873050 a=rtpmap:45 AV1/90000
2025-04-23 12:48:36.387874322 a=rtcp-fb:45 goog-remb
2025-04-23 12:48:36.387875604 a=rtcp-fb:45 transport-cc
2025-04-23 12:48:36.387876877 a=rtcp-fb:45 ccm fir
2025-04-23 12:48:36.387878120 a=rtcp-fb:45 nack
2025-04-23 12:48:36.387879397 a=rtcp-fb:45 nack pli
2025-04-23 12:48:36.387880729 a=fmtp:45 level-idx=5;profile=0;tier=0
2025-04-23 12:48:36.387882032 a=rtpmap:46 rtx/90000
2025-04-23 12:48:36.387883269 a=fmtp:46 apt=45
2025-04-23 12:48:36.387884532 a=rtpmap:47 AV1/90000
2025-04-23 12:48:36.387885768 a=rtcp-fb:47 goog-remb
2025-04-23 12:48:36.387887048 a=rtcp-fb:47 transport-cc
2025-04-23 12:48:36.387888336 a=rtcp-fb:47 ccm fir
2025-04-23 12:48:36.387889576 a=rtcp-fb:47 nack
2025-04-23 12:48:36.387890865 a=rtcp-fb:47 nack pli
2025-04-23 12:48:36.387892188 a=fmtp:47 level-idx=5;profile=1;tier=0
2025-04-23 12:48:36.387893461 a=rtpmap:48 rtx/90000
2025-04-23 12:48:36.387894695 a=fmtp:48 apt=47
2025-04-23 12:48:36.387895993 a=rtpmap:119 H264/90000
2025-04-23 12:48:36.387897265 a=rtcp-fb:119 goog-remb
2025-04-23 12:48:36.387898575 a=rtcp-fb:119 transport-cc
2025-04-23 12:48:36.387899861 a=rtcp-fb:119 ccm fir
2025-04-23 12:48:36.387901089 a=rtcp-fb:119 nack
2025-04-23 12:48:36.387902363 a=rtcp-fb:119 nack pli
2025-04-23 12:48:36.387903920 a=fmtp:119 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
2025-04-23 12:48:36.387905182 a=rtpmap:120 rtx/90000
2025-04-23 12:48:36.387906416 a=fmtp:120 apt=119
2025-04-23 12:48:36.387907705 a=rtpmap:121 H264/90000
2025-04-23 12:48:36.387908967 a=rtcp-fb:121 goog-remb
2025-04-23 12:48:36.387910252 a=rtcp-fb:121 transport-cc
2025-04-23 12:48:36.387911532 a=rtcp-fb:121 ccm fir
2025-04-23 12:48:36.387912787 a=rtcp-fb:121 nack
2025-04-23 12:48:36.387914067 a=rtcp-fb:121 nack pli
2025-04-23 12:48:36.387915722 a=fmtp:121 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=64001f
2025-04-23 12:48:36.387917040 a=rtpmap:122 rtx/90000
2025-04-23 12:48:36.387918290 a=fmtp:122 apt=121
2025-04-23 12:48:36.387919542 a=rtpmap:123 red/90000
2025-04-23 12:48:36.387920803 a=rtpmap:124 rtx/90000
2025-04-23 12:48:36.387922059 a=fmtp:124 apt=123
2025-04-23 12:48:36.387923366 a=rtpmap:125 ulpfec/90000
2025-04-23 12:48:36.387924717 a=rtpmap:49 flexfec-03/90000
2025-04-23 12:48:36.387925990 a=rtcp-fb:49 goog-remb
2025-04-23 12:48:36.387927264 a=rtcp-fb:49 transport-cc
2025-04-23 12:48:36.387928573 a=fmtp:49 repair-window=10000000
2025-04-23 12:48:36.387930024 m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
2025-04-23 12:48:36.387931324 c=IN IP4 0.0.0.0
2025-04-23 12:48:36.387932643 a=rtcp:9 IN IP4 0.0.0.0
2025-04-23 12:48:36.387933907 a=ice-ufrag:jbyJ
2025-04-23 12:48:36.387935240 a=ice-pwd:7y0HZQIJ+z1ugPPVGhTXEbZX
2025-04-23 12:48:36.387936510 a=ice-options:trickle
2025-04-23 12:48:36.387938251 a=fingerprint:sha-256 3E:03:03:0D:85:76:46:06:18:E7:48:B7:21:37:FA:10:C6:FD:A9:1E:FC:D8:AD:4B:03:FC:4C:CD:69:4C:FD:48
2025-04-23 12:48:36.387939545 a=setup:actpass
2025-04-23 12:48:36.387940767 a=mid:1
2025-04-23 12:48:36.387942203 a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
2025-04-23 12:48:36.387943774 a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
2025-04-23 12:48:36.387945394 a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
2025-04-23 12:48:36.387947107 a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
2025-04-23 12:48:36.387948345 a=recvonly
2025-04-23 12:48:36.387949624 a=rtcp-mux
2025-04-23 12:48:36.387950938 a=rtcp-rsize
2025-04-23 12:48:36.387952258 a=rtpmap:111 opus/48000/2
2025-04-23 12:48:36.387953617 a=rtcp-fb:111 transport-cc
2025-04-23 12:48:36.387954972 a=fmtp:111 minptime=10;useinbandfec=1
2025-04-23 12:48:36.387956251 a=rtpmap:63 red/48000/2
2025-04-23 12:48:36.387957515 a=fmtp:63 111/111
2025-04-23 12:48:36.387958775 a=rtpmap:9 G722/8000
2025-04-23 12:48:36.387960031 a=rtpmap:0 PCMU/8000
2025-04-23 12:48:36.387961314 a=rtpmap:8 PCMA/8000
2025-04-23 12:48:36.387962559 a=rtpmap:13 CN/8000
2025-04-23 12:48:36.387963882 a=rtpmap:110 telephone-event/48000
2025-04-23 12:48:36.387965221 a=rtpmap:126 telephone-event/8000
2025-04-23 12:48:36.387966418
2025-04-23 12:48:36.387996464 12:48:36.387 TRC [streams] check cons=0 media=video, sendonly, VP8, VP9, H264, AV1
2025-04-23 12:48:36.387997919 12:48:36.387 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265
2025-04-23 12:48:36.387999305 12:48:36.387 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/16000
2025-04-23 12:48:36.388000660 12:48:36.387 TRC [streams] check cons=0 prod=0 media=audio, sendonly, PCMU/8000
2025-04-23 12:48:36.388002184 12:48:36.387 TRC [streams] check cons=0 media=audio, sendonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000, L16, PCML
2025-04-23 12:48:36.388003526 12:48:36.387 TRC [streams] check cons=0 prod=0 media=video, recvonly, H265
2025-04-23 12:48:36.388011425 12:48:36.387 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/16000
2025-04-23 12:48:36.388033866 12:48:36.388 TRC [streams] check cons=0 prod=0 media=audio, sendonly, PCMU/8000
2025-04-23 12:48:36.388056937 12:48:36.388 DBG [webrtc] add consumer error="streams: codecs not matched: H265, AAC => VP8, VP9, H264, AV1, OPUS, G722, PCMU, PCMA, S16B, S16L"
I cannot tell if the webrtc errors are red herrings, the stream clearly shows it hosting the MSE version and not webrtc so i think these errors just show why webrtc is not hosting the stream. Any ideas on what i might be doing wrong or tips on configuring this camera would be appreciated. Thanks
Well. In which viewer do you have the wrong aspect ratio? And which one don't you have a problem with? For example ffplay or vlc.
Show stream probe from go2rtc WebUI.
The video aspect ratio playback is fine. I think it is go2rtc that doesnt like it. The camera's aspect ratio is 24:9 (4608x1728). I can view the stream fine in VLC as well as go2rtc up until a point. I guess that is what makes in confusing the go2rtc stream plays fine in the beginning then eventually just stops running , i dont see any apparent errors in the trace to understand why.
Ffprobe of go2trc webui:
root@eschaton:/opt# ffprobe rtsp://192.168.1.50:8554/front
ffprobe version N-108879-gcb803a0072 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared
libavutil 57. 39.101 / 57. 39.101
libavcodec 59. 51.100 / 59. 51.100
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 49.101 / 8. 49.101
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
[rtsp @ 0x558a6c781f40] method SETUP failed: 461 Unsupported transport
Input #0, rtsp, from 'rtsp://192.168.1.50:8554/front':
Metadata:
title : go2rtc/1.9.2
Duration: N/A, start: 0.093956, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuv420p(tv), 4608x1728, 20 fps, 90k tbr, 90k tbn
Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
So that rtps restream (rtsp://192.168.1.50:8554/front) runs fine in VLC. It is the stream.html running MSE that fails, the stream that Frigate and HA use
So. I don't understand. Aspect ratio fine, but problem that stream stops after some time?
I don't know why the stream fails after some time but, yes.
I am suspecting aspect ratio along with h265 because all other variables about this stream I have ruled out. I have cx820 and cx810 all 4k streams and load just fine. The aspect ratio makes this unique and I felt it was impacting go2rtc and h265 is notoriously difficult.
There is something missing in the logs to explain why it won't load. Any where else I can pull logs or metrics to better understand what might be happening?
It's probably problem with H265. It's a known problem when a H265 stream from some cameras doesn't work well. There's no universal way to fix it. H265 is a complex codec.
Such a bummer. Do you know a viable ffmpeg config to get it to h264? I'm guessing I'll have to lower the horizontal resolution to 4096 to be compatible
You trying to use hardware transcoding. And your card doesn't support so big resolutions.
I am using an RTX 2080, is that not enough? I think the error is complaining that h264 cannot encode more than 4096 and my resolution is 4608.
Width 4608 exceeds 4096\n[h264_nvenc @ ...
I was hoping to scale it and re-encode in h264, but I haven't been successful yet
Try to remove hardware param
First log into the web interface of your camera and change resolution to 4096x1536
In go2rtc: ffmpeg:rtsp://user:[email protected]:554/h264Preview_01_sub#video=h264#hardware OR (if you want audio) ffmpeg:rtsp://user:[email protected]:554/h264Preview_01_sub#video=h264#audio=copy#audio=aac#hardware
This works for me with Intel QuickSync Hardware transcoding.
I am using an RTX 2080, is that not enough? I think the error is complaining that h264 cannot encode more than 4096 and my resolution is 4608.
Width 4608 exceeds 4096\n[h264_nvenc @ ...I was hoping to scale it and re-encode in h264, but I haven't been successful yet
Change the in camera resolution, there is a 4096 available in camera
@Maxcodesthings OMG I thought it was just me and spent days troubleshooting before I saw your post which matches what I have experienced (Duo 2 Floodlight here).
Running Frigate 0.15.1 on an i5 NUC / Proxmox / LXC / Docker
Also had to downgrade ffmpeg to 5.0 or else errors creep into the logs after some time. What is frustrating is that the main stream at h265 works initially and for what seems like random stretches but then breaks and does not self-heal without a restart (I can still access go2rtc stream via VLC in those cases)
I am unwilling to lower main stream resolution on the camera for the sake of h264 re-encoding since I still rely on Reolink native app at this point and that is too much of a sacrifice.
I use Frigate mainly for movement/object detection and for that the sub stream is sufficient. It would be nice to use main for recording but I guess I can piggy back off sub for that as well for now.
Seems similar to my experience, however recording is working fine for me. Its trying to get it in a streaming format that fails which is HLS at this point since its x265. I settled for the sub stream and even lowere quality just to make sure it worked. I was resistent to it because i can use the 4k stream on all my other cameras so it didnt feel fair.
Re-encoding did not work well, an RTX 2080 was not enough (somehow?) and software only re-encoding destroyed my CPU
I think this is still a bunch of x265 mumbo-jumbo
You are right about recording working since no decoding needs to take place for it. I have mine set to only record motion and since detect is on a sub, Frigate must be smart enough to coordinate recording from main based on sub detection. This is great news since otherwise my camera would only be able to natively record to it's SD card, which is not ideal if someone decides to take the camera itself, and I don't use Reolink's NVR for this cam.
Surprising that 2080 can't encode, must be an optimization issue and likely means my NUC's GPU would not stand a chance anyway.
Thanks for the insight!
It is wrong to think that Intel GPUs are worse than Nvidia in terms of video transcoding. Intel is doing much better on the software side.
Reolink Duo Sufferers!
I believe I have found the solution to all these go2rtc+Duo woes after painstakingly testing each individual raw command line switch created by adding #video=h264#hardware=cuda to the RTSP stream on Reolink Duo main streams. We all know that the main stream is hevc/h265 and that type of stream is apparently impossible to deal with. The problematic go2rtc macro'd switch is -fflags nobuffer.
By adding a raw ffmpeg execution and supplying all switches EXCEPT for fflags nobuffer, my Duo Floodlight PoE feed is now transcoded via my Nvidia RTX3060 GPU to h264. The key commands looks like this:
front_drive_sub:
- ffmpeg:rtsp://{FRIGATE_RTSP_USERNAME}:{FRIGATE_RTSP_PASSWORD}@rlc-duo-1:554/h264Preview_01_sub
- ffmpeg:front_drive_sub#audio=opus
front_drive:
- exec:/lib/ffmpeg/7.0/bin/ffmpeg -hide_banner -v error -hwaccel cuda -hwaccel_output_format nv12 -flags low_delay -rtsp_transport tcp -i rtsp://{FRIGATE_RTSP_USERNAME}:{FRIGATE_RTSP_PASSWORD}@rlc-duo-1:554/h264Preview_01_main -c:v h264_nvenc -g 50 -bf 0 -profile:v high -level:v auto -preset:v p2 -tune:v ll -c:a copy -user_agent ffmpeg/go2rtc -f rtsp {{output}}
- ffmpeg:front_drive#audio=opus
Make sure you put that - ffmpeg:CAMERA_NAME#audio=opus on the line following your rtsp line and you'll have working WebRTC, audio will work in recordings, etc. This subsequent audio=opus conversion works on all 8 of my different styles of Reolink cameras to enable WebRTC in go2rtc! I've tried in vain to get it to work on a single line but have not had any success. I don't know what the difference is when doing a single line versus doing two separate lines but my guess is that it's like a pipeline and for some reason doing it all at once doesn't work.
TBH, I really just wish that Reolink offered a version of these cameras that was strictly h264! I'd pay more money for that... lol