Bugfix: Avoid repeat transcoding when the transcode is the same and source ip is localhost#3618
Closed
feixintianxia wants to merge 1 commit intoossrs:developfrom
Closed
Conversation
…ource ip is localhost
0bb9637 to
2e211f6
Compare
Member
|
see #4325 |
Member
|
Dup to #4325 |
winlinvip
added a commit
that referenced
this pull request
Jun 4, 2025
….0.41 (#4325) #### What issue has been resolved? for issue: #3516 #4055 #3618 #### What is the root cause of the problem? The issue arises from a mismatch between the `input` and `output` formats within the [`SrsEncoder::initialize_ffmpeg`](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L241-L254) function. For example: Input: `rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/livestream_ff` Output: `rtmp://127.0.0.1:1935/live/livestream_ff?vhost=__defaultVhost__` This may result in the failure of the [code segment](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L292-L298) responsible for determining whether to loop. #### What is the approach to solving this issue? It simply involves modifying the order of `stream` and `vhost`. #### How was the issue introduced? The commit introducing this bug is: 7d47017 The order of [parameters in the configuration file](7d47017#diff-428de168925d659dae72bb49273c3b048ed2800906c6848560badae854250126L26-R26) has been modified to address the `ingest` issue. #### Outstanding issues Please note that this PR does not entirely resolve the issue; for example, modifying the `output` format in configuration still results in exceptions. To comprehensively address this problem, extensive code modifications would be required. However, strictly adhering to the configuration file format can effectively prevent this issue. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com> Co-authored-by: john <hondaxiao@tencent.com> Co-authored-by: winlin <winlinvip@gmail.com>
winlinvip
added a commit
that referenced
this pull request
Jun 4, 2025
…4325) for issue: #3516 #4055 #3618 The issue arises from a mismatch between the `input` and `output` formats within the [`SrsEncoder::initialize_ffmpeg`](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L241-L254) function. For example: Input: `rtmp://127.0.0.1:1935/live?vhost=__defaultVhost__/livestream_ff` Output: `rtmp://127.0.0.1:1935/live/livestream_ff?vhost=__defaultVhost__` This may result in the failure of the [code segment](https://github.com/ossrs/srs/pull/4325/files#diff-a3dd7c498fc26d36def2e8c2c3b7edfe1bf78f0620b1a838aefa70ba119cad03L292-L298) responsible for determining whether to loop. It simply involves modifying the order of `stream` and `vhost`. The commit introducing this bug is: 7d47017 The order of [parameters in the configuration file](7d47017#diff-428de168925d659dae72bb49273c3b048ed2800906c6848560badae854250126L26-R26) has been modified to address the `ingest` issue. Please note that this PR does not entirely resolve the issue; for example, modifying the `output` format in configuration still results in exceptions. To comprehensively address this problem, extensive code modifications would be required. However, strictly adhering to the configuration file format can effectively prevent this issue. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com> Co-authored-by: john <hondaxiao@tencent.com> Co-authored-by: winlin <winlinvip@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When transcoding, if the output is set as "rtmp://127.0.0.1:[port]/[app]/[stream]_[engine]?vhost=[vhost]",
the source ip is "127.0.0.1", then it will cause repeated transcoding on the same server and the program crash.
For example:
TRANS_BY_GPT3