Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement]: Ability to manually set RTSP transport type #181

Open
apollo316 opened this issue Oct 10, 2022 · 10 comments
Open

[enhancement]: Ability to manually set RTSP transport type #181

apollo316 opened this issue Oct 10, 2022 · 10 comments
Labels
enhancement New feature or request stale

Comments

@apollo316
Copy link

Describe the solution you'd like

Can we get the option in advanced to set RTSP transport type to TCP or UDP?

@apollo316 apollo316 added the enhancement New feature or request label Oct 10, 2022
@github-actions
Copy link

Did you check this Road Map pages ?

@thieren
Copy link
Contributor

thieren commented Oct 11, 2022

Hi @apollo316

this would be out of scope of this plugin.

You could try and ask this question at eufy-security-client since this library is used to get the data from the cameras.

However looking at that codebase I don't recall stumbling on a feature like that. Also I don't think that this is supported by eufy.

@apollo316
Copy link
Author

apollo316 commented Oct 13, 2022 via email

@thieren
Copy link
Contributor

thieren commented Oct 13, 2022

Maybe I don't really get what you're trying to do.

In principle the way that home bridge-camera-ffmpeg and this plugin utilise the stream are not that different. But I have to say that there were some changes made in the past.

With home bridge-camera-ffmpeg you'll have to manually set the rtsp stream url. What are you setting there? I'd assume it is the exact same url that is used by this plugin. Where does TCP come into play? Apart from TCP being the default protocol for rtsp streams. I didn't check which is used for Dufts RTSP, but I'd assume it's the default.

@apollo316
Copy link
Author

apollo316 commented Oct 13, 2022 via email

@thieren
Copy link
Contributor

thieren commented Dec 1, 2022

Hi @apollo316

Sry for letting you wait so long. Did you figure it out in the meantime?

If not: you don't have to input the rtsp url anywhere as (like you have observed) the plugin gets it automatically. So the question is why the streaming fails. For that I'd need the log files for a streaming attempt. Can you provide these?

@neuhausf
Copy link

@thieren I get this problem too:

  1. RTSP Streaming enabled in your plugin
  2. Start streaming via Apple "Home"
  3. Log outputs something about "461 Unsupported transport"
  4. Stream starts anyway after a delay of about 2 seconds
    -> this could be an issue, that rtsp-transport must be specific: 461 Unsupported transport Sunoo/homebridge-camera-ffmpeg#1141
    -> you could expose a config option for this. I was previously using camera-ui, which has such an option:
    https://github.com/seydx/homebridge-camera-ui/wiki/Cameras-Config

I support @apollo316 s request: Please allow adding the RTSP source. Use case: I use the rtsp-simple-server to proxy the eufy RTSP stream. This allows me to use the RTSP stream also in home-assistant, synology and co.

[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage stream prepare request with session id 18f37863-98d4-4980-bc55-c9d9c2f461e8 was received.
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage Received request to start stream with id 18f37863-98d4-4980-bc55-c9d9c2f461e8
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage request data: {"sessionID":"18f37863-98d4-4980-bc55-c9d9c2f461e8","type":"start","video":{"codec":0,"profile":2,"level":2,"packetizationMode":0,"width":1280,"height":720,"fps":30,"pt":99,"ssrc":993109121,"max_bit_rate":299,"rtcp_interval":0.5,"mtu":1378},"audio":{"codec":"AAC-eld","channel":1,"bit_rate":0,"sample_rate":16,"packet_time":30,"pt":110,"ssrc":2555478536,"max_bit_rate":24,"rtcp_interval":5,"comfort_pt":13,"comfortNoiseEnabled":false}}
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage VIDEOCONFIG: {"audio":true,"vcodec":"copy","useSeparateProcesses":true,"audioSampleRate":0}
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage RTSP rtspStream:true
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage RTSP cameraConfig: true
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage RTSP true
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage RTSP "rtsp://Ec1FPt9s0UIE:pw@192.168.1.246/live0"
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: Garage RTSP URL: rtsp://Ec1FPt9s0UIE:pw@192.168.1.246/live0
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: [Garage] [Video Process] Stream command: /homebridge/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge/ffmpeg -hide_banner -loglevel level+verbose -use_wallclock_as_timestamps 1 -i rtsp://Ec1FPt9s0UIE:pw@192.168.1.246/live0 -an -sn -dn -vcodec copy -payload_type 99 -ssrc 4809461 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params zMXyb78nMK0bRmBkE2AZnnDpyPRk6PGmXQerTFaB srtp://192.168.1.230:59708?rtcpport=59708&pkt_size=1128 -progress tcp://127.0.0.1:14252
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] INFO:  [Garage] [Video Process] Starting video stream: native
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] DEBUG: [Garage] [Audio Process] Stream command: /homebridge/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge/ffmpeg -hide_banner -loglevel level+verbose -i rtsp://Ec1FPt9s0UIE:pw@192.168.1.246/live0 -vn -sn -dn -acodec libfdk_aac -profile:a aac_eld -flags +global_header -b:a 24k -ar 16k -ac 1 -payload_type 110 -ssrc 7522870 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params MmtuJOVHiFWs5mvdmOhdsdirUTMmVj1QMdKjXPc2 srtp://192.168.1.230:50090?rtcpport=50090&pkt_size=188 -progress tcp://127.0.0.1:11793
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] INFO:  [Garage] [Audio Process] Starting audio stream: 16 kHz, 24 kbps, codec: libfdk_aac
[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] ERROR: [Garage] [Video Process] ffmpeg log message:
[tcp @ 0x556673c549c0] [verbose] Starting connection attempt to 127.0.0.1 port 14252
[tcp @ 0x556673c549c0] [verbose] Successfully connected to 127.0.0.1 port 14252
[tcp @ 0x556673c5fd40] [verbose] Starting connection attempt to 192.168.1.246 port 554
[tcp @ 0x556673c5fd40] [verbose] Successfully connected to 192.168.1.246 port 554
[rtsp @ 0x556673c5d100] [verbose] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=H.264 Video,leco stream
c=IN IP4 0.0.0.0
t=0 0
a=tool:prv
a=control:*
m=video 0 RTP/AVP 96
b=AS:134
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=276400;sprop-parameter-sets=J2QAKq0AzoB4AiflmoCAgPgAAAMACAAAAwDxkAAFFcAAHoKL//gU,KO48sA==
a=control:trackID=0
m=audio 0 RTP/AVP 97
b=AS:131
a=rtpmap:97 MPEG4-GENERIC/16000/1
a=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1408
a=control:trackID=1


[rtsp @ 0x556673c5d100] [error] method SETUP failed: 461 Unsupported transport
[rtsp @ 0x556673c5d100] [verbose] setting jitter buffer size to 0
[rtsp @ 0x556673c5d100] [verbose] setting jitter buffer size to 0

[12/16/2022, 9:06:18 AM] [EufySecurity-2.2.0-beta.14] ERROR: [Garage] [Audio Process] ffmpeg log message:
[rtsp @ 0x55b3d44ea200] [error] method SETUP failed: 461 Unsupported transport

[12/16/2022, 9:06:19 AM] [EufySecurity-2.2.0-beta.14] DEBUG: [Garage] [Video Process] process started. Getting the first response took 1.625 seconds.
[12/16/2022, 9:06:20 AM] [EufySecurity-2.2.0-beta.14] DEBUG: [Garage] [Audio Process] process started. Getting the first response took 1.999 seconds.

@thieren
Copy link
Contributor

thieren commented Dec 17, 2022

@neuhausf

Thx for your input and investigation in the matter.

Am I getting it right that you'd want two additional options:

  1. to set a ffmpeg parameter for rtsp_transport auto/tcp/udp
  2. to set a manual rtsp source so you could use a proxy rtsp stream from your cameras?

What exactly is the benefit of the second? Couldn't you just use the native rtsp stream from the cameras for all your smartphone software?

@neuhausf
Copy link

@thieren thx for the summary.
My old cam (Tapo C210) had a hard limit of 1 or 2 parallel rtsp-streams. I think proxing the stream would offload the cam.

@github-actions
Copy link

github-actions bot commented Sep 8, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Development

No branches or pull requests

3 participants