Red5 / red5-server

Red5 Server core
Apache License 2.0
3.33k stars 982 forks source link

stream keys are immediately burned #339

Open marktheminer opened 1 year ago

marktheminer commented 1 year ago

Issue

Short description

I just setup the open source red5 server, and if I stream to it from OBS and then stop and try to start again, the key seems invalid and it forces me to choose a new one.

Ideally, I'd like to either have persistent keys or else persistent streams with no keys at all.

So either

stream: /live keys: one, two, three, four, etc.

or: stream 1: /one key 1: empty/null

stream 2: /two key 2: empty/null

etc.

If I have to burn keys like this, then I can't test the stream, stop and restart at X time as the key will be burned from the test stream.

Environment

[] Operating system and version: Ubuntu 22.04 LTS [] Java version: Amazon Corretto 11 [] Red5 version: 1.3.19

Expected behavior

Keys should remain valid beyond one time of use.

Actual behavior

Keys are burned after first use.

Steps to reproduce

  1. Begin streaming to /live with stream key one
  2. Stop streaming
  3. Start streaming again, observe error

Logs

Place logs on pastebin or elsewhere and put links here

mondain commented 1 year ago

In OBS your stream key is synonymous with stream name in Red5. With Red5 there are what we call scopes which could be understood as rooms or contexts; maybe some terms aren't clear or you're not waiting long enough between attempts, but know that stream names are not "burned" once used. When I use OBS, not often, I reuse stream1 over and over on live without issue. We have a short guide at Red5 Pro that might help https://www.red5pro.com/docs/protocols/third-party-publishers/obs/

marktheminer commented 1 year ago

Thanks, I had run across that guide.

Here's what I see in /var/log/syslog when I try to reuse a key shortly after ending a successful stream:

Jun 11 14:58:17 ingest-2 red5.sh[547]: [WARN] [RTMPRecv@D30RIWLL24Z9X] org.red5.server.net.rtmp.RTMPHandler - Scope not found Jun 11 14:58:17 ingest-2 red5.sh[547]: org.red5.server.exception.ScopeNotFoundException: Scope not found: LiveApp in null Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at org.red5.server.scope.ScopeResolver.resolveScope(ScopeResolver.java:101) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at org.red5.server.Context.resolveScope(Context.java:147) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at org.red5.server.net.rtmp.RTMPHandler.onCommand(RTMPHandler.java:331) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:123) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at org.red5.server.net.rtmp.RTMPConnection.lambda$handleMessageReceived$3(RTMPConnection.java:1518) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) Jun 11 14:58:17 ingest-2 red5.sh[547]: #011at java.base/java.lang.Thread.run(Thread.java:829) Jun 11 14:58:17 ingest-2 red5.sh[547]: [INFO] [RTMPRecv@D30RIWLL24Z9X] org.red5.server.net.rtmp.RTMPHandler - Scope LiveApp not found on {my ip hidden for this reply}

marktheminer commented 1 year ago

Even 40 minutes later it won't let me restart with similar log lines to the above plus one new one

Jun 11 15:38:36 ingest-2 red5.sh[547]: [ERROR] [RTMPRecv@FHFXOFTQCRIQV] org.red5.server.stream.StreamService - Bad name stream1