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

在双机部署互相配置对方为relay_pull时(场景为本地没有流就去目标地址回源)先pull的话会publish不了流 #364

Open
ShubinZheng opened this issue Dec 4, 2024 · 2 comments

Comments

@ShubinZheng
Copy link

ShubinZheng commented Dec 4, 2024

正常启动两个服务,互相配置双方为relay_pull的配置,如果先拉流,会publish不了流

2024/12/04 12:11:59.934429 ERROR [GROUP1] in stream already exist at group. add=RTMPPUBSUB2, exist=RTMPPULL1 - group__in.go:54
2024/12/04 12:11:59.934446 ERROR [RTMPPUBSUB2] doMsg failed. stream=header={Csid:4 MsgLen:80 MsgTypeId:20 MsgStreamId:1 TimestampAbs:0}, b=len(core)=4096, rpos=0, wpos=0, hex=, msg=0200077075626c6973680040140000000000000502003273747265616d3f6c616c5f7365637265743d30336232383061633563343231356237303933633238326664313231636462390200046c697665 - server_session.go:250

源码这里报错了 pkg/logic/group_in.go,这个hasInSession里面会是true,因为里面会判断group.hasPullSession(),而这个hasPullSession里面会去找pullProxy里面的session,即group.pullProxy.rtmpSession != nil,导致层层传递为true,但是我的pullProxy也就是另一个lal进程没有这个流

func (group *Group) AddRtmpPubSession(session *rtmp.ServerSession) error {
	group.mutex.Lock()
	defer group.mutex.Unlock()

	if group.hasInSession() {
		Log.Errorf("[%s] in stream already exist at group. add=%s, exist=%s",
			group.UniqueKey, session.UniqueKey(), group.inSessionUniqueKey())
		return base.ErrDupInStream
	}

	Log.Debugf("[%s] [%s] add rtmp pub session into group.", group.UniqueKey, session.UniqueKey())

	group.rtmpPubSession = session
	group.addIn()

	if group.shouldStartRtspRemuxer() {
		group.rtmp2RtspRemuxer = remux.NewRtmp2RtspRemuxer(
			group.onSdpFromRemux,
			group.onRtpPacketFromRemux,
		)
	}

	session.SetPubSessionObserver(group)

	return nil
}
@ShubinZheng ShubinZheng changed the title 在双机部署互相配置对方为relay_pull时(场景为本地没有流就去目标地址回源)会publish不了流 在双机部署互相配置对方为relay_pull时(场景为本地没有流就去目标地址回源)先pull的话会publish不了流 Dec 4, 2024
@joestarzxh
Copy link
Contributor

group只能允许一路流输入;所以你的场景需要在业务层保证不冲突

@ShubinZheng
Copy link
Author

我的目标是弄个集群,目前lal还不支持,希望后续支持吧,已经用了srs作为替换

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