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

GB: Support enabling media forwarding through API instead of SIP. #3384

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

duiniuluantanqin
Copy link
Member

@duiniuluantanqin duiniuluantanqin commented Jan 17, 2023

Support external signaling service, SRS only acts as a media server. Simply push RTP directly.

for #3369


TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jan 17, 2023

External signaling is certainly needed.

I took a quick look and have a question: Is it generally allocated in SDP to determine if the incoming SSRC is valid?

It seems that there is currently no API available, so it is assumed that all are accepted by default. The URL used is the SSRC instead of the device ID. It would be better to provide an HTTP API to set the device ID corresponding to the SSRC for better consistency.

Of course, an HTTP API would be more complex. We can consider if there are any better solutions available.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title GB:Support transport media without sip GB: Support transport media without sip Feb 16, 2023
@winlinvip winlinvip force-pushed the develop branch 3 times, most recently from c056094 to 2ac9eb8 Compare March 23, 2023 06:02
@duiniuluantanqin
Copy link
Member Author

duiniuluantanqin commented Feb 19, 2024

Add a new API, gb/v1/publish.

First, you can use Postman or a similar tool to send an HTTP POST request, as shown below.

POST /gb/v1/publish/
{
    "clientip": "192.168.1.100",
    "stream": "testname",
    "ssrc": "1234567890"
}
  • ssrc is randomly generated, typically a 10-digit number, and you should ensure its global uniqueness.
  • stream is the name of the stream, which you can use to pull the stream.

Then, you should recieve the response like:

{"port":9000, "is_tcp": true}

This indicates that the srs listening port is 9000.

currently srs only supports TCP transmission.

Now, you can use srs_bench to push RTP over TCP. The usage is as follows:

srs_bench -sfu gb28181 -mr tcp://127.0.0.1:9000 -ssrc 1234567890 -sa avatar.aac -sv avatar.h264 -fps 25

Finally, you can test the stream with:

rtmp://127.0.0.0/live/testname

TRANS_BY_GPT4

@duiniuluantanqin
Copy link
Member Author

duiniuluantanqin commented Mar 27, 2024

add gb_test func TestGbPublishWithApi
you can just test it with the commond

srs_gb28181_test --test.run TestGbPublishWithApi

@duiniuluantanqin duiniuluantanqin changed the title GB: Support transport media without sip GB: Support transport media through API instead of SIP. Mar 27, 2024
@duiniuluantanqin duiniuluantanqin changed the title GB: Support transport media through API instead of SIP. GB: Support enabling media forwarding through API instead of SIP. Mar 27, 2024
@winlinvip winlinvip linked an issue Apr 3, 2024 that may be closed by this pull request
@duiniuluantanqin
Copy link
Member Author

duiniuluantanqin commented Apr 28, 2024

https://github.com/ossrs/srs-sip
An external SIP signaling server that accompanies the SRS package.

TRANS_BY_GPT4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
2 participants