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

Why does obs-studio not handle any requests from the rtmp server during publishing? #11692

Open
shuxiao opened this issue Jan 2, 2025 · 2 comments

Comments

@shuxiao
Copy link

shuxiao commented Jan 2, 2025

Operating System Info

Windows 10

Other OS

Ubuntu 22.04

OBS Studio Version

Git

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/SMsVmSX1XirWIh6A

OBS Studio Crash Log URL

No response

Expected Behavior

OBS Studio can reply the server's ping request to let server calculate the rtt between obs and server.

Current Behavior

OBS Studio just ignore all requests from server during publishing.

Steps to Reproduce

Just publish any stream to remote rtmp server.

Anything else we should know?

I noticed that in the plugins/obs-outputs/rtmp-stream.c, the function process_recv_data() just ignores all packets. Why?

static bool process_recv_data(struct rtmp_stream *stream, size_t size)
{
	UNUSED_PARAMETER(size);

	RTMP *rtmp = &stream->rtmp;
	RTMPPacket packet = {0};

	if (!RTMP_ReadPacket(rtmp, &packet)) {
#ifdef _WIN32
		int error = WSAGetLastError();
#else
		int error = errno;
#endif
		do_log(LOG_ERROR, "RTMP_ReadPacket error: %d", error);
		return false;
	}

	if (packet.m_body) {
		/* do processing here */
		RTMPPacket_Free(&packet);
	}
	return true;
}
@shuxiao shuxiao changed the title Why does obs-studio not handle any requests from the server during publishing? Why does obs-studio not handle any requests from the rtmp server during publishing? Jan 2, 2025
@tt2468
Copy link
Member

tt2468 commented Jan 2, 2025

Are you able to link to wherever in the RTMP specification states that handling these messages is required?

@shuxiao
Copy link
Author

shuxiao commented Jan 2, 2025

Are you able to link to wherever in the RTMP specification states that handling these messages is required?

In the RTMP specification, the description about PingRequest is like this(7.1.7. User Control Message Events):

"The server sends this event to test whether the client is reachable. Event data is a 4-byte timestamp, representing the local server time when the server dispatched the command. The client responds with PingResponse on receiving MsgPingRequest."

I am not sure if this is a requirement for the client side. But I have tested the ffmpeg and XSplit, they both respond with PingResponse on receiving MsgPingRequest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants