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

Hope to add the stream_id attribute in the on_publish callback interface. #2837

Closed
stormbirds opened this issue Jan 1, 2022 · 10 comments
Closed
Assignees
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@stormbirds
Copy link

stormbirds commented Jan 1, 2022

Based on the current development version, during the process of implementing the SIP signaling server myself, I need to obtain stream information after the invitation to pull the stream. However, the current on_publish callback only provides app and stream, without stream_id. In this case, I need to first obtain the stream list through the http_api's api/v1/streams interface, and then filter out the specific stream information based on app and stream. I think it would be more appropriate to return the stream_id in the on_publish callback and save it on the business side. This way, the corresponding stream information can be directly obtained based on the stream_id.

TRANS_BY_GPT3

@winlinvip winlinvip added the Feature It's a new feature. label Jan 3, 2022
@winlinvip winlinvip added this to the 5.0 milestone Jan 3, 2022
@winlinvip
Copy link
Member

winlinvip commented Jan 3, 2022

Welcome to submit a patch.'
Make sure to maintain the markdown structure.

TRANS_BY_GPT3

@jinleileiking

This comment was marked as off-topic.

@winlinvip
Copy link
Member

winlinvip commented Jan 4, 2022

Please provide a detailed explanation of the specific application scenarios, instead of just giving a conclusion. Do not add any unnecessary information unless it is necessary.

TRANS_BY_GPT3

@jinleileiking

This comment was marked as off-topic.

@winlinvip
Copy link
Member

winlinvip commented Jan 4, 2022

Thank you, described very clearly. 👍

TRANS_BY_GPT3

@winlinvip winlinvip changed the title 希望在callback接口on_publish中增加streamId属性 希望在callback接口on_publish中增加stream_id属性 Apr 30, 2022
@drchzy
Copy link

drchzy commented Aug 19, 2022

Curve-saving law: Use the client_id in the callback information to query the clients interface => can obtain the stream_id.

TRANS_BY_GPT3

@28269890
Copy link

28269890 commented Aug 19, 2022

Not bad, not bad, I support it. My application scenario also needs this functionality.

Actual application situation: In the list, you can see the information of the stream currently being pushed, and you can also verify the running status of the stream.

To implement this application scenario, it is necessary to directly obtain the information of the stream. However, currently, the data submitted from the hook cannot be directly obtained from the API.


The ultimate goal is to be able to directly obtain the relevant information of the stream through the API, such as modifying the API, for example, api/v1/vhost/app/stream.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Aug 24, 2022

There is a way to bypass it, the callback will provide the client_id, for example:

        #       {
        #           "action": "on_publish",
        #           "client_id":"1y83d208",
        #           "ip": "192.168.1.10", "vhost": "video.test.com", "app": "live",
        #           "stream": "livestream", "param":"?token=xxx&salt=yyy", "server_id": "vid-werty"
        #       }

Then, by querying this client, you can obtain the stream_id:

http://localhost:1985/api/v1/clients/1y83d208

{
  "code": 0,
  "server": "srs-ie193id",
  "client": {
    "id": "1y83d208",
    "vhost": "vid-pg0862j",
    "stream": "vid-538tx0p",
    "ip": "127.0.0.1"
  }
}

Then, using vid-538tx0p, you can retrieve the information of the stream.

TRANS_BY_GPT3

@drchzy
Copy link

drchzy commented Aug 24, 2022 via email

@drchzy
Copy link

drchzy commented Oct 11, 2022 via email

@winlinvip winlinvip changed the title 希望在callback接口on_publish中增加stream_id属性 Hope to add the stream_id attribute in the on_publish callback interface. Jul 28, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants