Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

connection closed by peer on stopping the RTMP stream #1472

Closed
talhatsk opened this issue Jun 12, 2024 · 6 comments
Closed

connection closed by peer on stopping the RTMP stream #1472

talhatsk opened this issue Jun 12, 2024 · 6 comments
Labels
good first issue Indicates that an issue for newcommers.

Comments

@talhatsk
Copy link

Describe the bug

Hi,
when i try to stop the stream,FCUnpublish() followed by closeStream() is invoked and the RTMP server reports connection closed by peer which is not the desired effect. It should stop/kill the stream. Then i tried it through OBS, when i stopped from there it sent deleteStream() instead of closeStream() after FCUnpublish() which deleted the stream and invoked Webhooks.
image

Screenshot 2024-06-11 at 9 31 55 PM

To Reproduce

stop the stream and check on wireshark, you will see FCUnpublish() followed by closeStream()

Expected behavior

stopping the stream should call deleteStream() instead of closeStream()

Version

1.8.1

Smartphone info.

iPhone Xs Max

Additional context

No response

Screenshots

No response

Relevant log output

No response

@shogo4405
Copy link
Owner

I see. I believe the fix is simple, so I'm looking forward to your PR.

@shogo4405 shogo4405 added the good first issue Indicates that an issue for newcommers. label Jun 12, 2024
@xoraingroup
Copy link

@shogo4405 - It seems it might need to rename the command to deleteStream()

image

But I am not sure, if a separate method should be used to not break the API?

@xoraingroup
Copy link

@shogo4405 is this ok? I am waiting for a Yes or No :)

@shogo4405
Copy link
Owner

No. You need to consider the behavior when viewing, the behavior when using FCPublish, and the behavior when not using FCPublish. I have no knowledge regarding deleteStream, so I don't know. It will need to be investigated.

@xoraingroup
Copy link

closeStream closes stream but does not unpublish (delete) stream from rtmp server. This causes the rtmp server to not send webhooks because the stream is still there in rtmp server but in closed state and it waits for timeout of rtmp ingestion. The delete stream makes sure that the stream is unpublished from rtmp server and rtmp server sends the relevant webhooks to notify the relevant services. The webhooks are important part of creating flows and this is where we are stucked using this library.

From viewing perspective, the FCUnpublish with deleteStream unpublishes the stream and the client player just stops loading hls fragments. If fetching stream as rtmp pull, it just stops with error that stream does not exist.

I am not sure if i am making sense.

@levs42
Copy link
Contributor

levs42 commented Jun 24, 2024

It makes sense in the context of your specific RTMP server. There are many of them, and they tend to have different implementations of RTMP spec. Therefore the best options is to create a PR with an optional deleteStream call. Here #1393 is a good example of handing undocumented FCPublish command in an optional manner.

Repository owner locked and limited conversation to collaborators Jul 13, 2024
@shogo4405 shogo4405 converted this issue into discussion #1511 Jul 13, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
good first issue Indicates that an issue for newcommers.
Projects
None yet
Development

No branches or pull requests

4 participants