AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
6.7k stars 481 forks source link

Cam Reolink - bad image for MJPEG for 2K stream #83

Closed 007Nexus closed 2 years ago

007Nexus commented 2 years ago

Hi! Beelink U59(n5105, 8/512, ip:192.168.3.12) Home assistant Supervised 2022.10 go2rtc 0.1-beta.8 Camera Reolink 520A. Browsers: Chrome, Brave, Yandex. screen_go2rtc

go2rtc.yaml:
streams:
  cam1: 
    - rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main
    - ffmpeg:rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main#video=mjpeg

Log:

User-Agent: Lavf59.16.100

v=0
o=- 0 0 IN IP6 ::1
s=Session streamed by "preview"
c=IN IP6 ::1
t=0 0
a=tool:libavformat 59.16.100
m=video 0 RTP/AVP 26
b=AS:200
a=control:streamid=0
20:20:02.240 TRC [rtsp] server response:
RTSP/1.0 200 OK
Cseq: 2

20:20:02.240 DBG [exec] run launch=3.636064244s
20:20:02.240 TRC [streams] producer:1:0 candidate media="video, sendonly, 26 JPEG/90000"
20:20:02.240 TRC [streams] match producer:1:0 => consumer:0:0 codec="26 JPEG/90000"
20:20:02.240 DBG [streams] start producer url=ffmpeg:rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main#video=mjpeg
20:20:02.240 TRC [rtsp] server request:
SETUP rtsp://localhost:8554/2f2a82491593cecf2b5fb7bcca506dda/streamid=0 RTSP/1.0
Transport: RTP/AVP/TCP;unicast;interleaved=0-1;mode=record
Cseq: 3
User-Agent: Lavf59.16.100

20:20:02.240 TRC [rtsp] server response:
RTSP/1.0 200 OK
Transport: RTP/AVP/TCP;unicast;interleaved=0-1
Cseq: 3
Session: 1

20:20:02.241 TRC [rtsp] server request:
RECORD rtsp://localhost:8554/2f2a82491593cecf2b5fb7bcca506dda RTSP/1.0
Range: npt=0.000-
Cseq: 4
User-Agent: Lavf59.16.100
Session: 1

20:20:02.241 TRC [rtsp] server response:
RTSP/1.0 200 OK
Cseq: 4
Session: 1

Output #0, rtsp, to 'rtsp://localhost:8554/2f2a82491593cecf2b5fb7bcca506dda':
  Metadata:
    title           : Session streamed by "preview"
    comment         : h264Preview_01_main
    encoder         : Lavf59.16.100
  Stream #0:0: Video: mjpeg, yuvj420p(pc, progressive), 2560x1920, q=2-31, 200 kb/s, 30 fps, 90k tbn
    Metadata:
      encoder         : Lavc59.18.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
20:20:27.263 TRC [rtsp] server request:
OPTIONS rtsp://localhost:8554/2f2a82491593cecf2b5fb7bcca506dda RTSP/1.0
CSeq: 1
Session: 1

20:20:27.302 TRC [rtsp] server response:
RTSP/1.0 200 OK
Cseq: 1
Session: 1

frame=    1 fps=0.9 q=9.4 size=N/A time=00:00:01.76 bitrate=N/A speed=1.64x    
frame=    2 fps=1.2 q=7.5 size=N/A time=00:00:01.80 bitrate=N/A speed=1.09x    
frame=   14 fps=6.4 q=24.8 size=N/A time=00:00:02.20 bitrate=N/A speed=1.01x    
frame=   27 fps= 10 q=24.8 size=N/A time=00:00:02.63 bitrate=N/A speed=0.974x    
frame=   40 fps= 12 q=24.8 size=N/A time=00:00:03.06 bitrate=N/A speed=0.955x    
frame=   53 fps= 14 q=24.8 size=N/A time=00:00:03.50 bitrate=N/A speed=0.935x    
frame=   64 fps= 15 q=24.8 size=N/A time=00:00:03.86 bitrate=N/A speed=0.911x    
frame=   77 fps= 16 q=24.8 size=N/A time=00:00:04.30 bitrate=N/A speed=0.901x    
frame=   91 fps= 17 q=24.8 size=N/A time=00:00:04.76 bitrate=N/A speed=0.898x    
frame=  104 fps= 18 q=24.8 size=N/A time=00:00:05.20 bitrate=N/A speed=0.892x    
frame=  116 fps= 18 q=24.8 size=N/A time=00:00:05.60 bitrate=N/A speed=0.884x    
frame=  128 fps= 19 q=24.8 size=N/A time=00:00:06.00 bitrate=N/A speed=0.875x    
frame=  141 fps= 19 q=24.8 size=N/A time=00:00:06.43 bitrate=N/A speed=0.873x    
frame=  153 fps= 19 q=24.8 size=N/A time=00:00:06.83 bitrate=N/A speed=0.868x    
frame=  166 fps= 20 q=24.8 size=N/A time=00:00:07.26 bitrate=N/A speed=0.865x    
frame=  179 fps= 20 q=24.8 size=N/A time=00:00:07.70 bitrate=N/A speed=0.863x    
frame=  191 fps= 20 q=24.8 size=N/A time=00:00:08.10 bitrate=N/A speed=0.857x    
frame=  204 fps= 20 q=24.8 size=N/A time=00:00:08.53 bitrate=N/A speed=0.854x    
frame=  217 fps= 21 q=24.8 size=N/A time=00:00:08.96 bitrate=N/A speed=0.854x    
frame=  230 fps= 21 q=24.8 size=N/A time=00:00:09.40 bitrate=N/A speed=0.852x    
frame=  242 fps= 21 q=24.8 size=N/A time=00:00:09.80 bitrate=N/A speed=0.848x    
frame=  256 fps= 21 q=24.8 size=N/A time=00:00:10.26 bitrate=N/A speed=0.849x    
frame=  269 fps= 21 q=24.8 size=N/A time=00:00:10.70 bitrate=N/A speed=0.847x    
frame=  282 fps= 21 q=24.8 size=N/A time=00:00:11.13 bitrate=N/A speed=0.847x    
frame=  295 fps= 22 q=24.8 size=N/A time=00:00:11.56 bitrate=N/A speed=0.847x    
frame=  307 fps= 22 q=24.8 size=N/A time=00:00:11.96 bitrate=N/A speed=0.844x    
frame=  320 fps= 22 q=24.8 size=N/A time=00:00:12.40 bitrate=N/A speed=0.843x    
frame=  333 fps= 22 q=24.8 size=N/A time=00:00:12.83 bitrate=N/A speed=0.843x    
frame=  346 fps= 22 q=24.8 size=N/A time=00:00:13.26 bitrate=N/A speed=0.843x    
frame=  359 fps= 22 q=24.8 size=N/A time=00:00:13.70 bitrate=N/A speed=0.843x    
frame=  371 fps= 22 q=24.8 size=N/A time=00:00:14.10 bitrate=N/A speed=0.84x    
frame=  385 fps= 22 q=24.8 size=N/A time=00:00:14.56 bitrate=N/A speed=0.841x    
frame=  398 fps= 22 q=24.8 size=N/A time=00:00:15.00 bitrate=N/A speed=0.841x    
frame=  411 fps= 22 q=24.8 size=N/A time=00:00:15.43 bitrate=N/A speed=0.841x    
frame=  423 fps= 22 q=24.8 size=N/A time=00:00:15.83 bitrate=N/A speed=0.839x    
frame=  437 fps= 23 q=24.8 size=N/A time=00:00:16.30 bitrate=N/A speed=0.84x    
frame=  450 fps= 23 q=24.8 size=N/A time=00:00:16.73 bitrate=N/A speed=0.839x    
frame=  463 fps= 23 q=24.8 size=N/A time=00:00:17.16 bitrate=N/A speed=0.839x    
frame=  476 fps= 23 q=24.8 size=N/A time=00:00:17.60 bitrate=N/A speed=0.838x    
frame=  488 fps= 23 q=24.8 size=N/A time=00:00:18.00 bitrate=N/A speed=0.836x    
frame=  500 fps= 23 q=24.8 size=N/A time=00:00:18.40 bitrate=N/A speed=0.835x    
frame=  513 fps= 23 q=24.8 size=N/A time=00:00:18.83 bitrate=N/A speed=0.835x    
frame=  526 fps= 23 q=24.8 size=N/A time=00:00:19.26 bitrate=N/A speed=0.835x    
frame=  539 fps= 23 q=24.8 size=N/A time=00:00:19.70 bitrate=N/A speed=0.835x    
frame=  551 fps= 23 q=24.8 size=N/A time=00:00:20.10 bitrate=N/A speed=0.833x    
frame=  563 fps= 23 q=24.8 size=N/A time=00:00:20.50 bitrate=N/A speed=0.832x    
frame=  575 fps= 23 q=24.8 size=N/A time=00:00:20.90 bitrate=N/A speed=0.831x    
frame=  588 fps= 23 q=24.8 size=N/A time=00:00:21.33 bitrate=N/A speed=0.831x    
frame=  601 fps= 23 q=24.8 size=N/A time=00:00:21.76 bitrate=N/A speed=0.831x    
frame=  613 fps= 23 q=24.8 size=N/A time=00:00:22.16 bitrate=N/A speed=0.83x    
frame=  626 fps= 23 q=24.8 size=N/A time=00:00:22.60 bitrate=N/A speed=0.83x    
frame=  639 fps= 23 q=24.8 size=N/A time=00:00:23.03 bitrate=N/A speed=0.83x    
frame=  652 fps= 23 q=24.8 size=N/A time=00:00:23.46 bitrate=N/A speed=0.83x    
frame=  664 fps= 23 q=24.8 size=N/A time=00:00:23.86 bitrate=N/A speed=0.829x    
frame=  678 fps= 23 q=24.8 size=N/A time=00:00:24.33 bitrate=N/A speed=0.83x    
frame=  691 fps= 23 q=24.8 size=N/A time=00:00:24.76 bitrate=N/A speed=0.83x    
frame=  704 fps= 23 q=24.8 size=N/A time=00:00:25.20 bitrate=N/A speed=0.83x    
frame=  717 fps= 23 q=24.8 size=N/A time=00:00:25.63 bitrate=N/A speed=0.83x    
frame=  729 fps= 23 q=24.8 size=N/A time=00:00:26.03 bitrate=N/A speed=0.829x    
frame=  742 fps= 23 q=24.8 size=N/A time=00:00:26.46 bitrate=N/A speed=0.829x    
frame=  755 fps= 23 q=24.8 size=N/A time=00:00:26.90 bitrate=N/A speed=0.829x    
frame=  768 fps= 23 q=24.8 size=N/A time=00:00:27.33 bitrate=N/A speed=0.829x    
frame=  781 fps= 23 q=24.8 size=N/A time=00:00:27.76 bitrate=N/A speed=0.829x    
frame=  793 fps= 23 q=24.8 size=N/A time=00:00:28.16 bitrate=N/A speed=0.828x    
[h264 @ 0x7f30e3117c00] Increasing reorder buffer to 1
frame=  807 fps= 23 q=24.8 size=N/A time=00:00:28.63 bitrate=N/A dup=2 drop=0 speed=0.829x    
frame=  823 fps= 23 q=24.8 size=N/A time=00:00:29.16 bitrate=N/A dup=6 drop=0 speed=0.831x    
frame=  836 fps= 23 q=24.8 size=N/A time=00:00:29.60 bitrate=N/A dup=6 drop=0 speed=0.832x    
frame=  848 fps= 23 q=24.8 size=N/A time=00:00:30.00 bitrate=N/A dup=6 drop=0 speed=0.831x    
frame=  864 fps= 24 q=24.8 size=N/A time=00:00:30.53 bitrate=N/A dup=11 drop=0 speed=0.833x    
frame=  878 fps= 24 q=24.8 size=N/A time=00:00:31.00 bitrate=N/A dup=13 drop=0 speed=0.834x    
frame=  893 fps= 24 q=24.8 size=N/A time=00:00:31.50 bitrate=N/A dup=17 drop=0 speed=0.836x    
[h264 @ 0x7f30e3117c00] error while decoding MB 35 42, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame=  905 fps= 24 q=24.8 size=N/A time=00:00:31.90 bitrate=N/A dup=18 drop=0 speed=0.835x    
frame=  918 fps= 24 q=24.8 size=N/A time=00:00:32.33 bitrate=N/A dup=18 drop=0 speed=0.835x    
frame=  933 fps= 24 q=24.8 size=N/A time=00:00:32.83 bitrate=N/A dup=22 drop=0 speed=0.837x    
[h264 @ 0x7f30e3117c00] cabac decode of qscale diff failed at 147 56
[h264 @ 0x7f30e3117c00] error while decoding MB 147 56, bytestream 17271
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame=  951 fps= 24 q=24.8 size=N/A time=00:00:33.43 bitrate=N/A dup=28 drop=0 speed=0.84x    
[h264 @ 0x7f30e3117c00] error while decoding MB 114 79, bytestream -5
[h264 @ 0x7f30e3117c00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f30e3117c00] error while decoding MB 0 49, bytestream 60413
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
    Last message repeated 1 times
frame=  976 fps= 24 q=24.8 size=N/A time=00:00:34.26 bitrate=N/A dup=42 drop=0 speed=0.846x    
frame=  990 fps= 24 q=24.8 size=N/A time=00:00:34.73 bitrate=N/A dup=42 drop=0 speed=0.847x    
frame= 1004 fps= 24 q=24.8 size=N/A time=00:00:35.20 bitrate=N/A dup=42 drop=0 speed=0.848x    
frame= 1018 fps= 24 q=24.8 size=N/A time=00:00:35.66 bitrate=N/A dup=42 drop=0 speed=0.848x    
frame= 1039 fps= 24 q=24.8 size=N/A time=00:00:36.36 bitrate=N/A dup=53 drop=0 speed=0.852x    
frame= 1053 fps= 24 q=24.8 size=N/A time=00:00:36.83 bitrate=N/A dup=53 drop=0 speed=0.853x    
frame= 1067 fps= 24 q=24.8 size=N/A time=00:00:37.30 bitrate=N/A dup=53 drop=0 speed=0.854x    
[h264 @ 0x7f30e3117c00] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f30e3117c00] error while decoding MB 0 101, bytestream 16446
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
20:22:13.741 TRC [api] GET url=/api/stream.mjpeg?src=vorota
20:22:13.741 TRC [streams] consumer:1:0 candidate media="video, recvonly, 0 JPEG/0"
20:22:13.741 TRC [streams] producer:0:0 candidate media="video, sendonly, 96 H264/90000"
20:22:13.741 TRC [streams] producer:0:1 candidate media="audio, sendonly, 97 MPEG4-GENERIC/16000"
20:22:13.741 TRC [streams] producer:1:0 candidate media="video, sendonly, 26 JPEG/90000"
20:22:13.741 TRC [streams] match producer:1:0 => consumer:1:0 codec="26 JPEG/90000"
frame= 1081 fps= 24 q=24.8 size=N/A time=00:00:37.76 bitrate=N/A dup=53 drop=0 speed=0.854x    
frame= 1101 fps= 25 q=24.8 size=N/A time=00:00:38.43 bitrate=N/A dup=65 drop=0 speed=0.858x    
frame= 1117 fps= 25 q=24.8 size=N/A time=00:00:38.96 bitrate=N/A dup=69 drop=0 speed=0.86x    
frame= 1131 fps= 25 q=24.8 size=N/A time=00:00:39.43 bitrate=N/A dup=69 drop=0 speed=0.861x    
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
exit OK`
20:23:59.778 TRC [rtsp] server response:
RTSP/1.0 200 OK
Cseq: 3
Session: 1

frame= 1980 fps= 26 q=24.8 size=N/A time=00:01:07.73 bitrate=N/A dup=326 drop=0 speed=0.892x    
frame= 1999 fps= 26 q=24.8 size=N/A time=00:01:08.36 bitrate=N/A dup=338 drop=0 speed=0.894x    
frame= 2012 fps= 26 q=24.8 size=N/A time=00:01:08.80 bitrate=N/A dup=338 drop=0 speed=0.894x    
frame= 2025 fps= 26 q=24.8 size=N/A time=00:01:09.23 bitrate=N/A dup=338 drop=0 speed=0.893x    
frame= 2038 fps= 26 q=24.8 size=N/A time=00:01:09.66 bitrate=N/A dup=338 drop=0 speed=0.893x    
frame= 2058 fps= 26 q=24.8 size=N/A time=00:01:10.33 bitrate=N/A dup=351 drop=0 speed=0.895x    
frame= 2071 fps= 26 q=24.8 size=N/A time=00:01:10.76 bitrate=N/A dup=351 drop=0 speed=0.895x    
frame= 2085 fps= 26 q=24.8 size=N/A time=00:01:11.23 bitrate=N/A dup=353 drop=0 speed=0.895x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 6, bytestream 19261
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
[h264 @ 0x7f4854f43900] cabac decode of qscale diff failed at 46 38
[h264 @ 0x7f4854f43900] error while decoding MB 46 38, bytestream 20256
frame= 2099 fps= 26 q=24.8 size=N/A time=00:01:11.70 bitrate=N/A dup=356 drop=0 speed=0.895x    
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2116 fps= 26 q=24.8 size=N/A time=00:01:12.26 bitrate=N/A dup=366 drop=0 speed=0.896x    
frame= 2129 fps= 26 q=24.8 size=N/A time=00:01:12.70 bitrate=N/A dup=366 drop=0 speed=0.895x    
frame= 2142 fps= 26 q=24.8 size=N/A time=00:01:13.13 bitrate=N/A dup=367 drop=0 speed=0.895x    
[h264 @ 0x7f4854f43900] error while decoding MB 107 119, bytestream -5
[h264 @ 0x7f4854f43900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4854f43900] error while decoding MB 0 68, bytestream 16469
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
    Last message repeated 1 times
frame= 2160 fps= 26 q=24.8 size=N/A time=00:01:13.73 bitrate=N/A dup=374 drop=0 speed=0.896x    
frame= 2178 fps= 26 q=24.8 size=N/A time=00:01:14.33 bitrate=N/A dup=388 drop=0 speed=0.898x    
frame= 2194 fps= 26 q=24.8 size=N/A time=00:01:14.86 bitrate=N/A dup=394 drop=0 speed=0.898x    
frame= 2208 fps= 26 q=24.8 size=N/A time=00:01:15.33 bitrate=N/A dup=397 drop=0 speed=0.899x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 39, bytestream 16647
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2230 fps= 26 q=24.8 size=N/A time=00:01:16.06 bitrate=N/A dup=407 drop=0 speed= 0.9x    
[h264 @ 0x7f4854f43900] error while decoding MB 16 85, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2244 fps= 26 q=24.8 size=N/A time=00:01:16.53 bitrate=N/A dup=410 drop=0 speed= 0.9x    
frame= 2256 fps= 26 q=24.8 size=N/A time=00:01:16.93 bitrate=N/A dup=410 drop=0 speed=0.899x    
frame= 2271 fps= 26 q=24.8 size=N/A time=00:01:17.43 bitrate=N/A dup=415 drop=0 speed= 0.9x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 45, bytestream 1253
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2293 fps= 26 q=24.8 size=N/A time=00:01:18.16 bitrate=N/A dup=427 drop=0 speed=0.901x    
frame= 2307 fps= 26 q=24.8 size=N/A time=00:01:18.63 bitrate=N/A dup=430 drop=0 speed=0.901x    
frame= 2319 fps= 26 q=24.8 size=N/A time=00:01:19.03 bitrate=N/A dup=430 drop=0 speed= 0.9x    
frame= 2332 fps= 26 q=24.8 size=N/A time=00:01:19.46 bitrate=N/A dup=430 drop=0 speed= 0.9x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4854f43900] error while decoding MB 0 69, bytestream 17791
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2351 fps= 26 q=24.8 size=N/A time=00:01:20.10 bitrate=N/A dup=439 drop=0 speed= 0.9x    
frame= 2365 fps= 26 q=24.8 size=N/A time=00:01:20.56 bitrate=N/A dup=441 drop=0 speed= 0.9x    
frame= 2378 fps= 26 q=24.8 size=N/A time=00:01:21.00 bitrate=N/A dup=442 drop=0 speed= 0.9x    
frame= 2394 fps= 26 q=24.8 size=N/A time=00:01:21.53 bitrate=N/A dup=450 drop=0 speed=0.901x    
frame= 2408 fps= 26 q=24.8 size=N/A time=00:01:22.00 bitrate=N/A dup=453 drop=0 speed=0.901x    
frame= 2423 fps= 26 q=24.8 size=N/A time=00:01:22.50 bitrate=N/A dup=458 drop=0 speed=0.901x    
[h264 @ 0x7f4854f43900] error while decoding MB 4 93, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2437 fps= 26 q=24.8 size=N/A time=00:01:22.96 bitrate=N/A dup=462 drop=0 speed=0.901x    
frame= 2449 fps= 26 q=24.8 size=N/A time=00:01:23.36 bitrate=N/A dup=462 drop=0 speed= 0.9x    
[h264 @ 0x7f4854f43900] error while decoding MB 103 102, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2478 fps= 27 q=24.8 size=N/A time=00:01:24.33 bitrate=N/A dup=481 drop=0 speed=0.902x    
frame= 2492 fps= 27 q=24.8 size=N/A time=00:01:24.80 bitrate=N/A dup=484 drop=0 speed=0.902x    
frame= 2504 fps= 27 q=24.8 size=N/A time=00:01:25.20 bitrate=N/A dup=484 drop=0 speed=0.902x    
[h264 @ 0x7f4854f43900] cabac decode of qscale diff failed at 13 49
[h264 @ 0x7f4854f43900] error while decoding MB 13 49, bytestream 19095
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 51, bytestream 15731
frame= 2519 fps= 27 q=24.8 size=N/A time=00:01:25.70 bitrate=N/A dup=491 drop=0 speed=0.902x    
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2536 fps= 27 q=24.8 size=N/A time=00:01:26.26 bitrate=N/A dup=503 drop=0 speed=0.903x    
frame= 2551 fps= 27 q=24.8 size=N/A time=00:01:26.76 bitrate=N/A dup=508 drop=0 speed=0.904x    
[h264 @ 0x7f4854f43900] error while decoding MB 140 38, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2564 fps= 27 q=24.8 size=N/A time=00:01:27.20 bitrate=N/A dup=509 drop=0 speed=0.903x    
frame= 2576 fps= 27 q=24.8 size=N/A time=00:01:27.60 bitrate=N/A dup=509 drop=0 speed=0.903x    
[h264 @ 0x7f4854f43900] cabac decode of qscale diff failed at 14 30
[h264 @ 0x7f4854f43900] error while decoding MB 14 30, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2589 fps= 27 q=24.8 size=N/A time=00:01:28.03 bitrate=N/A dup=510 drop=0 speed=0.902x    
frame= 2604 fps= 27 q=24.8 size=N/A time=00:01:28.53 bitrate=N/A dup=517 drop=0 speed=0.903x    
frame= 2618 fps= 27 q=24.8 size=N/A time=00:01:29.00 bitrate=N/A dup=520 drop=0 speed=0.903x    
frame= 2630 fps= 27 q=24.8 size=N/A time=00:01:29.40 bitrate=N/A dup=520 drop=0 speed=0.902x    
frame= 2654 fps= 27 q=24.8 size=N/A time=00:01:30.20 bitrate=N/A dup=532 drop=0 speed=0.903x    
frame= 2666 fps= 27 q=24.8 size=N/A time=00:01:30.60 bitrate=N/A dup=532 drop=0 speed=0.902x    
frame= 2679 fps= 27 q=24.8 size=N/A time=00:01:31.03 bitrate=N/A dup=535 drop=0 speed=0.902x    
[h264 @ 0x7f4854f43900] error while decoding MB 123 114, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
20:24:24.771 TRC [rtsp] server request:
OPTIONS rtsp://localhost:8554/2f2a82491593cecf2b5fb7bcca506dda RTSP/1.0
CSeq: 4
Session: 1

frame= 2694 fps= 27 q=24.8 size=N/A time=00:01:31.53 bitrate=N/A dup=541 drop=0 speed=0.902x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4854f43900] error while decoding MB 0 2, bytestream 85081
20:24:24.804 TRC [rtsp] server response:
RTSP/1.0 200 OK
Cseq: 4
Session: 1

rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2707 fps= 27 q=24.8 size=N/A time=00:01:31.96 bitrate=N/A dup=542 drop=0 speed=0.902x    
frame= 2727 fps= 27 q=24.8 size=N/A time=00:01:32.63 bitrate=N/A dup=558 drop=0 speed=0.903x    
frame= 2741 fps= 27 q=24.8 size=N/A time=00:01:33.10 bitrate=N/A dup=561 drop=0 speed=0.903x    
frame= 2755 fps= 27 q=24.8 size=N/A time=00:01:33.56 bitrate=N/A dup=565 drop=0 speed=0.903x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 87, bytestream 41161
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2789 fps= 27 q=24.8 size=N/A time=00:01:34.70 bitrate=N/A dup=592 drop=0 speed=0.906x    
[h264 @ 0x7f4854f43900] error while decoding MB 159 108, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2802 fps= 27 q=24.8 size=N/A time=00:01:35.13 bitrate=N/A dup=592 drop=0 speed=0.906x    
frame= 2816 fps= 27 q=24.8 size=N/A time=00:01:35.60 bitrate=N/A dup=596 drop=0 speed=0.906x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x7f4854f43900] error while decoding MB 0 70, bytestream 33403
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2843 fps= 27 q=24.8 size=N/A time=00:01:36.50 bitrate=N/A dup=617 drop=0 speed=0.908x    
frame= 2861 fps= 27 q=24.8 size=N/A time=00:01:37.10 bitrate=N/A dup=625 drop=0 speed=0.909x    
[h264 @ 0x7f4854f43900] error while decoding MB 14 68, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2874 fps= 27 q=24.8 size=N/A time=00:01:37.53 bitrate=N/A dup=626 drop=0 speed=0.908x    
frame= 2888 fps= 27 q=24.8 size=N/A time=00:01:38.00 bitrate=N/A dup=629 drop=0 speed=0.908x    
[h264 @ 0x7f4854f43900] error while decoding MB 45 50, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2902 fps= 27 q=24.8 size=N/A time=00:01:38.46 bitrate=N/A dup=632 drop=0 speed=0.908x    
frame= 2918 fps= 27 q=24.8 size=N/A time=00:01:39.00 bitrate=N/A dup=640 drop=0 speed=0.909x    
frame= 2933 fps= 27 q=24.8 size=N/A time=00:01:39.50 bitrate=N/A dup=646 drop=0 speed=0.909x    
[h264 @ 0x7f4854f43900] error while decoding MB 126 3, bytestream -57
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 2946 fps= 27 q=24.8 size=N/A time=00:01:39.93 bitrate=N/A dup=648 drop=0 speed=0.908x    
frame= 2958 fps= 27 q=24.8 size=N/A time=00:01:40.33 bitrate=N/A dup=648 drop=0 speed=0.908x    
frame= 2970 fps= 27 q=24.8 size=N/A time=00:01:40.73 bitrate=N/A dup=648 drop=0 speed=0.907x    
frame= 2986 fps= 27 q=24.8 size=N/A time=00:01:41.26 bitrate=N/A dup=656 drop=0 speed=0.908x    
frame= 3000 fps= 27 q=24.8 size=N/A time=00:01:41.73 bitrate=N/A dup=660 drop=0 speed=0.908x    
frame= 3017 fps= 27 q=24.8 size=N/A time=00:01:42.30 bitrate=N/A dup=671 drop=0 speed=0.909x    
frame= 3029 fps= 27 q=24.8 size=N/A time=00:01:42.70 bitrate=N/A dup=671 drop=0 speed=0.908x    
frame= 3046 fps= 27 q=24.8 size=N/A time=00:01:43.26 bitrate=N/A dup=682 drop=0 speed=0.909x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 52, bytestream 17164
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 3060 fps= 27 q=24.8 size=N/A time=00:01:43.73 bitrate=N/A dup=688 drop=0 speed=0.909x    
frame= 3078 fps= 27 q=24.8 size=N/A time=00:01:44.33 bitrate=N/A dup=701 drop=0 speed=0.91x    
frame= 3090 fps= 27 q=24.8 size=N/A time=00:01:44.73 bitrate=N/A dup=701 drop=0 speed=0.91x    
frame= 3102 fps= 27 q=24.8 size=N/A time=00:01:45.13 bitrate=N/A dup=701 drop=0 speed=0.909x    
frame= 3118 fps= 27 q=24.8 size=N/A time=00:01:45.66 bitrate=N/A dup=707 drop=0 speed=0.909x    
frame= 3136 fps= 27 q=24.8 size=N/A time=00:01:46.26 bitrate=N/A dup=718 drop=0 speed=0.91x    
frame= 3149 fps= 27 q=24.8 size=N/A time=00:01:46.70 bitrate=N/A dup=718 drop=0 speed=0.91x    
frame= 3161 fps= 27 q=24.8 size=N/A time=00:01:47.10 bitrate=N/A dup=718 drop=0 speed=0.909x    
frame= 3175 fps= 27 q=24.8 size=N/A time=00:01:47.56 bitrate=N/A dup=722 drop=0 speed=0.909x    
frame= 3190 fps= 27 q=24.8 size=N/A time=00:01:48.06 bitrate=N/A dup=728 drop=0 speed=0.909x    
frame= 3206 fps= 27 q=24.8 size=N/A time=00:01:48.60 bitrate=N/A dup=736 drop=0 speed=0.91x    
[h264 @ 0x7f4854f43900] error while decoding MB 100 69, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 3220 fps= 27 q=24.8 size=N/A time=00:01:49.06 bitrate=N/A dup=741 drop=0 speed=0.91x    
frame= 3239 fps= 27 q=24.8 size=N/A time=00:01:49.70 bitrate=N/A dup=753 drop=0 speed=0.911x    
frame= 3253 fps= 27 q=24.8 size=N/A time=00:01:50.16 bitrate=N/A dup=759 drop=0 speed=0.911x    
[h264 @ 0x7f4854f43900] error while decoding MB 148 48, bytestream -9
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 3270 fps= 27 q=24.8 size=N/A time=00:01:50.73 bitrate=N/A dup=769 drop=0 speed=0.911x    
frame= 3284 fps= 27 q=24.8 size=N/A time=00:01:51.20 bitrate=N/A dup=772 drop=0 speed=0.911x    
frame= 3297 fps= 27 q=24.8 size=N/A time=00:01:51.63 bitrate=N/A dup=775 drop=0 speed=0.911x    
[h264 @ 0x7f4854f43900] left block unavailable for requested intra mode
[h264 @ 0x7f4854f43900] error while decoding MB 0 27, bytestream 17161
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0
frame= 3314 fps= 27 q=24.8 size=N/A time=00:01:52.20 bitrate=N/A dup=787 drop=0 speed=0.912x    
[h264 @ 0x7f4854f43900] error while decoding MB 119 27, bytestream -5
rtsp://admin:XXXXXX@192.168.3.22:554/h264Preview_01_main: corrupt decoded frame in stream 0

What I tried to do: The camera is on/off. The integration has been reloaded. Checked on the TP-link Tapo C200 camera - everything is fine.

NickM-27 commented 2 years ago

Reolinks RTSP implementation is incredibly bad, it is often recommended to use their RTMP connection instead. Mine looks like this:

streams:
  backyard_cam: ffmpeg:http://192.168.1.4/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=user&password=password
007Nexus commented 2 years ago

Reolinks RTSP implementation is incredibly bad, it is often recommended to use their RTMP connection instead. Mine looks like this:

streams:
  backyard_cam: ffmpeg:http://192.168.1.4/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=user&password=password

Thanks for the answer. But where does port 1935 come from? There is no such thing in the documentation. VLC does not play this link. This is not the first time I've seen this (reolink recommendations for Frigate), but it doesn't work for me. Perhaps this is for other cameras? The RTSP stream on my camera is pretty stable, btw. Log go2rtc: 16:41:51.042 DBG [streams] probe producer url=ffmpeg:http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX#video=mjpeg 16:41:51.043 DBG [exec] run url="exec:ffmpeg -hide_banner -fflags nobuffer -flags low_delay -i http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX -codec:v mjpeg -force_duplicated_matrix 1 -huffman 0 -pix_fmt yuvj420p -an -rtsp_transport tcp -f rtsp rtsp://localhost:8554/99cf4cd5f0ce3a85fe5526b817fd3fd4" http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX: Invalid data found when processing input

Log Frigate: [2022-10-20 19:26:12] ffmpeg.vorota.detect ERROR : http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX: Invalid data found when processing input [2022-10-20 19:26:12] frigate.video ERROR : vorota: Unable to read frames from ffmpeg process. [2022-10-20 19:26:12] frigate.video ERROR : vorota: ffmpeg process is not running. exit capture thread...

NickM-27 commented 2 years ago

But where does port 1935 come from? There is no such thing in the documentation.

Port 1935 is the standard RTMP port, just like how 554 is the standard RTSP port

Log Frigate: [2022-10-20 19:26:12] ffmpeg.vorota.detect ERROR : http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX: Invalid data found when processing input [2022-10-20 19:26:12] frigate.video ERROR : vorota: Unable to read frames from ffmpeg process. [2022-10-20 19:26:12] frigate.video ERROR : vorota: ffmpeg process is not running. exit capture thread...

If you tried it in frigate, it looks like you didn't change your input_args which is of course required https://docs.frigate.video/configuration/camera_specific#reolink-410520-possibly-others

007Nexus commented 2 years ago

If you tried it in frigate, it looks like you didn't change your input_args which is of course required https://docs.frigate.video/configuration/camera_specific#reolink-410520-possibly-others

Thanks for the answer. Of course, I read the frigate documentation, and added input_args: -avoid_negative_ts

But this doesn't work for me. Above I gave part of the log.

VLC should open a video from a link?: http://192.168.3.22/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXX VLC won't open this link for me. My camera is Reolink-520A.

NickM-27 commented 2 years ago

Interesting, maybe you have something disabled in the reolink cameras settings under Network Settings -> Advanced

We've had many users validate / use these settings with the 520a specifically and other reolink cams as well. I'm using it with 511WA personally

007Nexus commented 2 years ago

reolink_ports

Interesting, maybe you have something disabled in the reolink cameras settings under Network Settings -> Advanced

We've had many users validate / use these settings with the 520a specifically and other reolink cams as well. I'm using it with 511WA personally

I replaced in the settings only what is recommended here: https://docs.frigate.video/configuration/camera_specific/#reolink-410520-possibly-others

I can try to factory reset the camera, but it hangs high. reolink

NickM-27 commented 2 years ago

Oh, that looks different than my view, I wonder if you are not on the latest firmware for the camera.

(also recommend doing it in general, as it gives more options for setting the iframe interval and constant or variable frame rate)

Screen Shot 2022-10-20 at 12 51 28 PM https://reolink.com/us/download-center/

007Nexus commented 2 years ago

Oh, that looks different than my view, I wonder if you are not on the latest firmware for the camera.

(also recommend doing it in general, as it gives more options for setting the iframe interval and constant or variable frame rate)

I'm trying to update the firmware, but: reolink_fail_update

AlexxIT commented 2 years ago

RTP MJPEG https://www.rfc-editor.org/rfc/rfc2435#section-3.1.5 The maximum width is 2040 pixels. The maximum height is 2040 pixels.

I have added a fix for 2560x1920 and 2560x1440 https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-beta.9

If anyone has a problem with other resolutions, write them here.

007Nexus commented 2 years ago

We've had many users validate / use these settings with the 520a specifically and other reolink cams as well.

I wrote to reolink support - they sent the firmware for my camera (for IPC_523128M5MP_V2, not IPC_523128M5MP). I updated the firmware, RTMP (go2rtc and frigate) started working normally. With the latest update go2rtc 0.1-beta.9, the conversion to MJPEG started working normally. Thank you very much!

xfaustus commented 1 year ago

can you please share it with us? Meanwhile i contacted support, still this update is not present on their website. I'm slowly changing all my reolink cameras with Dahua, much better hardware and software. And it's really frustrating with RTSP, i didn't find a way to get it working flawlessly... With Dahua, another story, all so fast and smooth!

007Nexus commented 1 year ago

can you please share it with us?

Sure! Firmware Reolink 520A

xfaustus commented 1 year ago

can you please share it with us?

Sure! Firmware Reolink 520A

Thanks, meanwhile i got from Reolink (i have RLC520A v2)

seanblanchfield commented 1 year ago

@AlexxIT said to mention any other problem resolutions.

I have added a fix for 2560x1920 and 2560x1440 https://github.com/AlexxIT/go2rtc/releases/tag/v0.1-beta.9 If anyone has a problem with other resolutions, write them here.

I have the misfortune of owning a Reolink 820A 4k IP cam. Its main stream supports 3840x2160, 2560x1440 and 2304x1296. I had it configured at the lowest of these resolutions (2304x1296) and couldn't get it to work in go2rtc (although it was working as a direct RTSP stream in Frigate). After finding this issue, I changed the resolution to 2560x1440 and everything worked. It would be great to also add a fix for 2304x1296 so it's not necessary to use a higher resolution stream.

AlexxIT commented 1 year ago

Two new resolutions in release https://github.com/AlexxIT/go2rtc/releases/tag/v1.1.2