koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
3.9k stars 237 forks source link

Rebroadcast Error - rebroadcast error Error: rtsp socket closed - HiLook ColorVu Camera #1499

Closed msd252 closed 2 weeks ago

msd252 commented 2 weeks ago

Upon adding a Hillock ColorVu camera to Scypted the rebroadcast plugin fails after around 2 seconds of streaming with a "rtsp socket closed error". I have verified the RTSP stream from the camera is stable which it is (both through VLC and by disabling the rebroadcast plugin on scrypted and viewing through the management console).

The rebroadcast streams seems to restart and then fail again.

Steps to reproduce the behavior:

Error log:

Rebroadcast Plugin: Drive Camera restarting prebuffer session in 5 seconds Rebroadcast Plugin: Stream 1 prebuffer session started Rebroadcast Plugin: Stream 1 prebuffer session starting stream url rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast Rebroadcast Plugin: rtsp outgoing message Rebroadcast Plugin: OPTIONS rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast RTSP/1.0 Rebroadcast Plugin: CSeq: 0 Rebroadcast Plugin: User-Agent: Scrypted Rebroadcast Plugin: Rebroadcast Plugin: rtsp incoming message Rebroadcast Plugin: RTSP/1.0 200 OK Rebroadcast Plugin: CSeq: 0 Rebroadcast Plugin: Public: OPTIONS, DESCRIBE, GET_PARAMETER, PAUSE, PLAY, SETUP, SET_PARAMETER, TEARDOWN Rebroadcast Plugin: Date: Sun, Jun 16 2024 21:45:39 GMT Rebroadcast Plugin: Rebroadcast Plugin: rtsp outgoing message Rebroadcast Plugin: DESCRIBE rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast RTSP/1.0 Rebroadcast Plugin: Accept: application/sdp Rebroadcast Plugin: CSeq: 1 Rebroadcast Plugin: User-Agent: Scrypted Rebroadcast Plugin: Rebroadcast Plugin: rtsp incoming message Rebroadcast Plugin: RTSP/1.0 401 Unauthorized Rebroadcast Plugin: CSeq: 1 Rebroadcast Plugin: WWW-Authenticate: Digest realm="IP Camera(AX598)", nonce="18bcc9855d42184620cdf8f8329de3e1", stale="FALSE" Rebroadcast Plugin: Date: Sun, Jun 16 2024 21:45:39 GMT Rebroadcast Plugin: Rebroadcast Plugin: rtsp outgoing message Rebroadcast Plugin: DESCRIBE rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast RTSP/1.0 Rebroadcast Plugin: Accept: application/sdp Rebroadcast Plugin: CSeq: 2 Rebroadcast Plugin: User-Agent: Scrypted Rebroadcast Plugin: Authorization: Digest username="admin", realm="IP Camera(AX598)", nonce="18bcc9855d42184620cdf8f8329de3e1", uri="rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast", algorithm="MD5", response="2e61119e5958d2d09a1f7a12ce38a4bf" Rebroadcast Plugin: Rebroadcast Plugin: rtsp incoming message Rebroadcast Plugin: RTSP/1.0 200 OK Rebroadcast Plugin: CSeq: 2 Rebroadcast Plugin: Content-Type: application/sdp Rebroadcast Plugin: Content-Base: rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/ Rebroadcast Plugin: Content-Length: 662 Rebroadcast Plugin: Rebroadcast Plugin: sdp v=0 Rebroadcast Plugin: o=- 1718574339951134 1718574339951134 IN IP4 192.168.1.126 Rebroadcast Plugin: s=Media Presentation

Rebroadcast Plugin: t=0 0

Rebroadcast Plugin: m=video 0 RTP/AVP 96 Rebroadcast Plugin: c=IN IP4 0.0.0.0

Rebroadcast Plugin: a=rtpmap:96 H264/90000 Rebroadcast Plugin: a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z0IAKY2NQDwBE/LNwEBAUAAAjKAAFfkAQA==,aM44gA==

Rebroadcast Plugin: rtsp outgoing message Rebroadcast Plugin: SETUP rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/trackID=1?transportmode=unicast RTSP/1.0 Rebroadcast Plugin: Transport: RTP/AVP/TCP;unicast;interleaved=0-1 Rebroadcast Plugin: CSeq: 3 Rebroadcast Plugin: User-Agent: Scrypted Rebroadcast Plugin: Authorization: Digest username="admin", realm="IP Camera(AX598)", nonce="18bcc9855d42184620cdf8f8329de3e1", uri="rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/trackID=1?transportmode=unicast", algorithm="MD5", response="8b6546df1826588ccae82a0438e04aa0" Rebroadcast Plugin: Rebroadcast Plugin: rtsp incoming message Rebroadcast Plugin: RTSP/1.0 200 OK Rebroadcast Plugin: CSeq: 3 Rebroadcast Plugin: Session: 498060278;timeout=60 Rebroadcast Plugin: Transport: RTP/AVP/TCP;unicast;interleaved=0-1;ssrc=5df07664;mode="play" Rebroadcast Plugin: Date: Sun, Jun 16 2024 21:45:39 GMT Rebroadcast Plugin: Rebroadcast Plugin: parsed sdp sps { width: 1920, height: 1080 } Rebroadcast Plugin: No audio stream detected. Rebroadcast Plugin: rtsp outgoing message Rebroadcast Plugin: PLAY rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast RTSP/1.0 Rebroadcast Plugin: Range: npt=0.000- Rebroadcast Plugin: CSeq: 4 Rebroadcast Plugin: User-Agent: Scrypted Rebroadcast Plugin: Authorization: Digest username="admin", realm="IP Camera(AX598)", nonce="18bcc9855d42184620cdf8f8329de3e1", uri="rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/?transportmode=unicast", algorithm="MD5", response="a172c81b615640a56d2180f4219b372d" Rebroadcast Plugin: Session: 498060278 Rebroadcast Plugin: Rebroadcast Plugin: rtsp incoming message Rebroadcast Plugin: RTSP/1.0 200 OK Rebroadcast Plugin: CSeq: 4 Rebroadcast Plugin: Session: 498060278 Rebroadcast Plugin: RTP-Info: url=rtsp://192.168.1.126:554/ISAPI/Streaming/channels/101/trackID=1?transportmode=unicast;seq=7591;rtptime=130944614 Rebroadcast Plugin: Date: Sun, Jun 16 2024 21:45:40 GMT Rebroadcast Plugin: Rebroadcast Plugin: parsed bitstream sps { width: 1920, height: 1080 } Rebroadcast Plugin: rebroadcast error Error: rtsp socket closed Rebroadcast Plugin: at Socket. (/@scrypted/prebuffer-mixin/main.nodejs.js:1:140295) Rebroadcast Plugin: at Socket.emit (node:events:531:35) Rebroadcast Plugin: at Socket.emit (node:domain:488:12) Rebroadcast Plugin: at TCP. (node:net:338:12) Rebroadcast Plugin: Stream 1 prebuffer session ended Rebroadcast Plugin: Drive Camera restarting prebuffer session in 5 seconds

Rebroadcast plugin also seems unable to get codec or bitrate information:

image image

- OS: Proxmox Scrypted Install - also verified the same error on Scrypted Mac app.

- Device: HiLook IPC-T259H-MU https://www.hikvision.com/uk/products/HiLook-IP-Products/Network-Cameras/value-camera/ipc-t259h-mu/ Latest firmware

- Software: Error verified on both Scrypted management console, NVR, HomeKit and VLC (viewing rebroadcast URL)

Additional context: Multiple camera video settings have also been tried. Multiple versions of the rebroadcast plugin have also been tried. No special characters in camera password. I have also tried to change the default parser to ffmpeg. When doing this the behavior is the same with a different error now present in the log:

Rebroadcast Plugin: rebroadcast parse error Error: RTSP Server expected frame magic but received: TEAR Rebroadcast Plugin: at x.handleRecord (/@scrypted/prebuffer-mixin/main.nodejs.js:1:90630) Rebroadcast Plugin: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Rebroadcast Plugin: at async Object.parse (/@scrypted/prebuffer-mixin/main.nodejs.js:1:82919) Rebroadcast Plugin: at async /@scrypted/prebuffer-mixin/main.nodejs.js:1:71260 Rebroadcast Plugin: rebroadcast error Error: RTSP Server expected frame magic but received: TEAR Rebroadcast Plugin: at x.handleRecord (/@scrypted/prebuffer-mixin/main.nodejs.js:1:90630) Rebroadcast Plugin: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Rebroadcast Plugin: at async Object.parse (/@scrypted/prebuffer-mixin/main.nodejs.js:1:82919) Rebroadcast Plugin: at async /@scrypted/prebuffer-mixin/main.nodejs.js:1:71260 Rebroadcast Plugin: Stream 1 prebuffer session ended

msd252 commented 2 weeks ago

Is it possible to enable any further logging so I can diagnose this error further?

This also only occurs with this type of camera. Other HiLook cameras (slightly older) not not have this issue.

koush commented 2 weeks ago

try FFmpeg parser in streams options

msd252 commented 2 weeks ago

Thanks I did do that but receive the below error. I have also been unable to find other closed or open issues with the same error.

[Rebroadcast Plugin]: rebroadcast parse error Error: RTSP Server expected frame magic but received: TEAR [Rebroadcast Plugin]: at x.handleRecord (/@scrypted/prebuffer-mixin/main.nodejs.js:1:90630) [Rebroadcast Plugin]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [Rebroadcast Plugin]: at async Object.parse (/@scrypted/prebuffer-mixin/main.nodejs.js:1:82919) [Rebroadcast Plugin]: at async /@scrypted/prebuffer-mixin/main.nodejs.js:1:71260 [Rebroadcast Plugin]: rebroadcast error Error: RTSP Server expected frame magic but received: TEAR [Rebroadcast Plugin]: at x.handleRecord (/@scrypted/prebuffer-mixin/main.nodejs.js:1:90630) [Rebroadcast Plugin]: at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [Rebroadcast Plugin]: at async Object.parse (/@scrypted/prebuffer-mixin/main.nodejs.js:1:82919) [Rebroadcast Plugin]: at async /@scrypted/prebuffer-mixin/main.nodejs.js:1:71260 [Rebroadcast Plugin]: Stream 1 prebuffer session ended

koush commented 2 weeks ago

need full logs.

koush commented 2 weeks ago

would be easier to discuss in discord

msd252 commented 2 weeks ago

Il post in the Rebroadcast section thanks!

koush commented 2 weeks ago

camera bug

msd252 commented 2 weeks ago

I have switched to UDP rather than TCP and this has fixed the issue. This is confirmed as a camera bug rather than Scypted.