Edward-Wu / srt-live-server

srt live server for low latency
Other
644 stars 192 forks source link

SRT options #12

Open j3dd4h opened 4 years ago

j3dd4h commented 4 years ago

How we can configure SRT options eg: passphrase, oheadbw ?

Edward-Wu commented 4 years ago

hi, j3dd4h I don't know what you use as the srt publisher or player. If you use ffmpeg , you can put the passphrase and oheadbw behind the streamid, like following: ./ffplay -fflag nobuffer -i "srt://[your.sls.ip]:8080?streamid=live.sls.com/live/test&passphrase=...

j3dd4h commented 4 years ago

I'm using ffmpeg as publisher. Below error occurs when try to use passphrase:


09:53:51.252461/SRT:RcvQ:worker*E:SRT.c: HS KMREQ: Peer declares encryption, but agent does not - rejecting per strict requirement
09:53:51.252514/SRT:RcvQ:worker*E:SRT.c: @285068533:newConnection: connection rejected due to: CONNECTION REJECTED
09:53:51.252529/SRT:RcvQ:worker*E:SRT.c: UU:newConnection: rsp(REJECT): 1011 - Password required or unexpected
Edward-Wu commented 4 years ago

sorry, I didn't take these parameters into account, I will take them into a new version.

rebotnix commented 4 years ago

I have the same issue when passphrase is set. Did anyone found a solution?

11:54:18.969259/SRT:RcvQ:w1E:SRT.c: HS KMREQ: Peer declares encryption, but agent does not 11:54:18.969331/SRT:RcvQ:w1E:SRT.c: @269805372:newConnection: connection rejected due to: CONNECTION REJECTED 11:54:18.969355/SRT:RcvQ:w1*E:SRT.c: UU:newConnection: rsp(REJECT): 1011 - Password required or unexpected

anders-d commented 4 years ago

I solved it by setting a hardcoded passphrase in SLSSrt.cpp, in the libsrt_setup function. Ugly, but it works for me when only distributing a single stream to several viewers. I passed it to srtlib with SRTO_PASSPHRASE. If using VLC for viewing I recommend you using a VLC 4 nightly build, srt passphrase implementation seems to be bad in VLC 3.

eivindga commented 3 years ago

@anders-d thank you for suggesting a simple fix! It's pretty dirty yeah, but it solved my immediate problem.

For anyone interested, just add a line with something this: srt_setsockopt(fd, SRTO_PASSPHRASE, SRTO_PASSPHRASE, "REPLACE_PASSWORD", 16)

jengajenga commented 3 years ago

@anders-d thank you for suggesting a simple fix! It's pretty dirty yeah, but it solved my immediate problem.

For anyone interested, just add a line with something this: srt_setsockopt(fd, SRTO_PASSPHRASE, SRTO_PASSPHRASE, "REPLACE_PASSWORD", 16)

hmmm.... let me try this out