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

RTMP stream forwarding (Forward) is specified through a URL. #231

Closed
wants to merge 12 commits into from
Closed

RTMP stream forwarding (Forward) is specified through a URL. #231

wants to merge 12 commits into from

Conversation

daozhao
Copy link

@daozhao daozhao commented May 12, 2015

RTMP stream forwarding (Forward) is specified through a URL with the hashtag 53.

Usage: No additional configuration is required in the configuration file.
When pushing, the forward parameter can be added in the app. Currently, only adding parameters in the app is supported.
For example:
Method 1: Add forward IP and port
Push address: rtmp://192.168.2.170:1935/myapp?forward=192.168.2.170:19350/mystream
The server will automatically push the stream to the server 192.168.2.170:19350.
View the forward address: rtmp://192.168.2.170:19350/myapp/mystream to play the stream.
View the source address: rtmp://192.168.2.170:1935/myapp/mystream
Method 2: Add forward complete address
Push address: rtmp://192.168.2.170:1935/myapp?forward=rtmp%3A%2F%2F192%2E168%2E2%2E170%3A19350%2Fyapp%2Fystream/mystream
Or
rtmp://192.168.2.170:1935/myapp...forward...rtmp%3A%2F%2F192%2E168%2E2%2E170%3A19350%2Fyapp%2Fystream/mystream
The server will automatically push to the server according to the address rtmp://192.168.2.170:19350/yapp/ystream.
View the forward address: rtmp://192.168.2.170:19350/yapp/ystream.
View the source address: rtmp://192.168.2.170:1935/myapp/mystream.

Also, please note that the forward complete address needs to be URI encoded. You can use the objs/research/librtmp/srs_rtmp_uri_encode tool for encoding. A demonstration of the URI encoding program can be found in trunk/research/librtmp/srs_rtmp_uri_encode.c.


TRANS_BY_GPT3

daozhao added 12 commits May 5, 2015 11:23
* 2.0release:
  support push flv stream over HTTP POST to SRS.
  fix the unicode to ascii
  add stream status to api.
  update donation
  update donation
  enable hls for push flv.
  update donation.
  add push flv conf
  fix the flv caster bug, when nread is 0, disconnect it.
  fix the http flv stream caster.
  refine the http message, set the connection if required.
  refine code, use decoder to parse flv stream
  fix the http read chunked encoding bug.
@winlinvip
Copy link
Member

winlinvip commented May 13, 2015

Why do we need to specify the forward address when connecting?

TRANS_BY_GPT3

@daozhao
Copy link
Author

daozhao commented May 14, 2015

Actually, I just referenced your vhost where the parameters are passed on the connect. Actually, I also find it strange. Usually, it is better to add the forward address at the end of the address.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented May 14, 2015

Why not specify these parameters in the configuration file?

TRANS_BY_GPT3

@daozhao
Copy link
Author

daozhao commented May 14, 2015

#53

This makes it more convenient to change whether to forward the stream at any time.

Currently, we have a use case where most of the streams only need to be viewed on the local network. They do not need to be viewed on the internet. However, sometimes certain playback sources need to be played on the internet. If this forwarding is configured through a config file, it is not very flexible.

Additionally, if authentication is required when using a third-party CDN, the authentication information needs to be included in the URL. This makes it very inflexible to configure through a configuration file.

TRANS_BY_GPT3

@daozhao daozhao changed the title 添加Forward支持额外参数 RTMP流转发(Forward)通过url来指定 May 14, 2015
@winlinvip
Copy link
Member

winlinvip commented May 14, 2015

Authentication information should be placed in the URL because it often changes.
However, vhost definitely does not need to change frequently.
If vhost is placed in the URL, the player needs to trigger a forward. This behavior is also new and may not be very suitable for open source.
Therefore, if you can change it to write vhost in the configuration, I can merge it into SRS. Please consider it, thank you for submitting the code~

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented May 15, 2015

If you think it's appropriate, you can support adding vhost information in the foward, submit a new pull request, I have closed this for now.
You're doing great, keep it up~

TRANS_BY_GPT3

@winlinvip winlinvip closed this May 15, 2015
@winlinvip winlinvip changed the title RTMP流转发(Forward)通过url来指定 RTMP stream forwarding (Forward) is specified through a URL. Jul 29, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
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
Development

Successfully merging this pull request may close these issues.

2 participants