[WebSDK] Fail to pull rtsp stream

felix_aider

New Member
Hi

I'm trying to make a website with several rtsp streams played at the same time.

As is in the demos, I am using WebSDK and create stream with rtsp uri as stream name.

Unfortunately, I'm having trouble pulling rtsp streams time to time.

Oddly, I can play my rtsp stream on VLC player, but the stream won't just start on my WCS instance.

my rtsp stream uri looks like this, rtsp://{username}:{password}@{host}:{port}/ch4/stream1.

The `Stream.getInfo()` would return 'Failed to connect to rtsp stream'.

I tried starting up my stream with rest-api request, but it returns ok with status code 200.

How should I do?
 

Max

Administrator
Staff member
Hello

Please list all your RTSP URLs or send us using this private form
Make sure each requested RTSP URL works in VLC.
We will check urls and report for each URL (report without full IP address).

Regarding VLC. This software contains a lot of tweaks for IP cams violating specifications and sending incorrect streams.
We go this way too. But we need particular IP cam endpoints and vendors for our set of tweaks.
 

felix_aider

New Member
I do not have the authority to determine whether I can share the rtsp stream URIs, but I discovered that rebooting WCS resolves the issue.

I suspect that a component responsible for rtsp pull in WCS may have failed, and rebooting brought it back to life.

However, I couldn't determine if the server was malfunctioning because every POST request to '/rest-api/rtsp/startup' returned a response with a status code of 200.

Btw, I'm trying to pull like 30~40 rtsp streams on a browser at the same time and here is the error log.

01:54:02,956 INFO NodeApi - HTTP-pool-3-thread-13884 Connection failed stream name - { my rtsp uri }
01:54:02,956 INFO AgentFactory - HTTP-pool-3-thread-13884 Provide stream initialization result com.flashphoner.server.remote.E$_A@64d6db14
01:54:02,979 INFO RestApiRouter - HTTP-pool-3-thread-12748 Use controller class com.flashphoner.rest.server.rest_v2.RestRtspController with path /rest-api/rtsp/terminate
01:54:02,979 INFO RestApiRouter - HTTP-pool-3-thread-12748 handleRequest method: /rest-api/rtsp/terminate, params:{uri= { my rtsp uri }}
01:54:03,090 INFO RestApiRouter - HTTP-pool-3-thread-13884 Use controller class com.flashphoner.rest.server.rest_v2.RestRtspController with path /rest-api/rtsp/startup
01:54:03,090 INFO RestApiRouter - HTTP-pool-3-thread-13884 handleRequest method: /rest-api/rtsp/startup, params:{localStreamName={ my local stream name}, uri={ my rtsp uri }}
01:54:03,091 ERROR RtspAgents - HTTP-pool-3-thread-13884 Can't create rtspClient
com.flashphoner.server.B.A.G: No free ports available
at com.flashphoner.server.B.A.C.E(Unknown Source)
at com.flashphoner.server.remote.E.D.allocatePort(Unknown Source)
at com.flashphoner.server.remote.B.<init>(Unknown Source)
at com.flashphoner.server.remote.E.D.<init>(Unknown Source)
at com.flashphoner.server.remote.E.A.C(Unknown Source)
at com.flashphoner.server.remote.E.A.createAgent(Unknown Source)
at com.flashphoner.server.remote.E.A(Unknown Source)
at com.flashphoner.server.remote.E.B(Unknown Source)
at com.flashphoner.server.remote.L.A(Unknown Source)
at com.flashphoner.server.remote.L.A(Unknown Source)
at com.flashphoner.rest.server.NodeApi.startupRtspAgent(Unknown Source)
at com.flashphoner.rest.server.rest_v2.RestRtspController.startup(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor1425.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.flashphoner.rest.server.RestApiRouter.getResponse(Unknown Source)
at com.flashphoner.rest.server.RestApiRouter.processRequest(Unknown Source)
at com.flashphoner.server.http.handlers.RestApiRequestHandler.process(Unknown Source)
at com.flashphoner.server.http.G.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.socket.nio.NioWorker.read(Unknown Source)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(Unknown Source)
at org.jboss.netty.channel.socket.nio.DeadlockAwareNioWorker.run(Unknown Source)
at org.jboss.netty.util.ThreadRenamingRunnable.run(Unknown Source)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)

Is there any solution for this problem or any possible reasons?

Plus, what possibly could be the reason for stream.getInfo() 'Failed by ICE timeout'?
 
Last edited:

Max

Administrator
Staff member
01:54:03,091 ERROR RtspAgents - HTTP-pool-3-thread-13884 Can't create rtspClient
com.flashphoner.server.B.A.G: No free ports available
Seems like you need to expand media ports range:
Code:
media_port_from=20000
media_port_to=39999
and RTSP agent ports range
Code:
rtsp_port_from=40000
rtsp_port_to=50000
 

Max

Administrator
Staff member
How should I configure my ec2 inbound and outbound configurations?
To expand media ports range, change the settings in /usr/local/FlashphonerWebCallServer/conf/flashphoner.properties as we recommend above.
Then configure the security group in the instance settings. Here is the default configuration
1706501668453.png

You should change 30000-33000 to 20000-39999.
 

felix_aider

New Member
Sorry Max, but I'm having trouble playing the streams again.

Streams fail with stream.getInfo method returning 'Failed by ICE timeout'.

I did change my flashphoner.properties file and ec2 inbound rules and theses are my configurations now.

1706511411842.png

1706511541088.png


Everything seemed to work just fine but now, I can't play a single stream.

/?action=stat&params=streams_viewers&format=json request shows that there are rtsp streams created with 0 viewers each.

What could have gone wrong?
Btw, I'm playing about 20 streams on a page.
Could it be the reason?
 
Last edited:
Top