RTSP stream name

Yossi

New Member
Hi!
I'm using WCS 5.2.945
I publish an rtsp video stream to the server by using its dns name rtsp://<flashphoner-dns-name>:554/live/my-stream
I want to play it with web-rtc and rtmp players and I only able to play when I provide to the player the stream name with the direct server ip streamName=rtsp://<flashphoner-IP>:554/live/my-stream

It doesn't work if I try to play with the dns name.

Is there a way to play rtsp stream without knowing the direct IP address of the server?
Thanks
 

Max

Administrator
Staff member
What DNS name server is configured on your Linux system where WCS installed?

i.e.

/etc/resolve.conf
nameserver 8.8.8.8

Make sure your DNS server is fast enough to fetch dynamic configuration.
Try google DNS 8.8.8.8 or 8.8.4.4
 

Yossi

New Member
WCS server is on AWS.
/etc/resolve.conf doesn't exist
Yet, the server able to resolve the dns-name to the private ip (tested by ping)
 

Max

Administrator
Staff member
Please clarify your case:
1. Do you publish RTP stream to WCS from ffmpeg via RTSP like this
Code:
ffmpeg -stream_loop -1 -re -i bunny360p.mp4 -c:a libopus -ac 2 -ar 48000 -c:v copy -b:a 96K -b:v 500K -f rtsp -rtsp_transport tcp rtsp://<flashphoner-dns-name>:554/my-stream
?
In this case, WCS server DNS name is resolved on publisher side, so DNS on publishing client needs to be checked.
2. Or do you play a stream as RTSP from WCS? In this case you should not use RTSP link in WebRTC player unless you're trying to play a stream published on one WCS server from another WCS server. Use just stream name in WebRTC player:
Code:
https://<flashphoner-dns-name>:8888/embed_player?urlServer=wss://<flashphoner-dns-name>:8443&streamName=my-stream&mediaProviders=WebRTC
 

Yossi

New Member
Hi Max! Thanks!
I publish the rtsp with ffmpeg just like you wrote on the first option.

For an example, if I try to play the stream with ffplay I have to use this line "ffplay rtmp://<flashphoner-dns-name>:1935/rtsp://<flashphoner-dns-name>:554/my-stream"
But the DNS name doesn't resolved on the player side (it is just part of the stream name), and I believe that WCS also uses the stream-name as is, as a key to fetch the correct stream which probably mapped with the private ip and not with the DNS name.

So again, how can I publish & play rtsp using DNS name?
Thanks!
 

Max

Administrator
Staff member
For an example, if I try to play the stream with ffplay I have to use this line "ffplay rtmp://<flashphoner-dns-name>:1935/rtsp://<flashphoner-dns-name>:554/my-stream"
That's wrong. Please see the documentation. You should use the stream name only, but not all the RTSP publishing URL.
For example, if you're publishing rtsp://<flashphoner-dns-name>:554/my-stream, you should play it like this as RTMP
Code:
ffplay rtmp://<flashphoner-dns-name>:1935/live/my-stream
or like this as RTSP
Code:
ffplay rtsp://<flashphoner-dns-name>:554/my-stream
1620716098318.png

So in both cases server DNS name should be resolved on publishing or playing client side respectively, but no on the server side.
 

Yossi

New Member
Thanks.
I've tried again to play it the way you play but I still got "stream not found" error. When I pass the full URL as stream name it plays okay.
 
Last edited:

Yossi

New Member
I sent the information. Thanks.
But another issue I encountered while trying to prepare the instance is that the latest WCS (5.2.940) on AWS market place doesn't work for me and I had to launch previous version and then upgrade.
I've tried to launce it on t3.small and t3.medium and WCS server failed to start.
I saw the following errors in gc-core log file:

Code:
[2021-05-12T06:08:24.256+0000] Initializing The Z Garbage Collector
[2021-05-12T06:08:24.256+0000] Version: 14.0.1+7 (release)
[2021-05-12T06:08:24.256+0000] NUMA Support: Disabled
[2021-05-12T06:08:24.256+0000] CPUs: 2 total, 2 available
[2021-05-12T06:08:24.256+0000] Memory: 1955M
[2021-05-12T06:08:24.256+0000] Large Page Support: Disabled
[2021-05-12T06:08:24.256+0000] Medium Page Size: 32M
[2021-05-12T06:08:24.256+0000] Workers: 2 parallel, 1 concurrent
[2021-05-12T06:08:24.257+0000] Address Space Type: Contiguous/Unrestricted/Complete
[2021-05-12T06:08:24.257+0000] Address Space Size: 262144M x 3 = 786432M
[2021-05-12T06:08:24.257+0000] Heap backed by file: /memfd:java_heap
[2021-05-12T06:08:24.257+0000] Min Capacity: 16384M
[2021-05-12T06:08:24.257+0000] Initial Capacity: 16384M
[2021-05-12T06:08:24.257+0000] Max Capacity: 16384M
[2021-05-12T06:08:24.257+0000] Max Reserve: 36M
[2021-05-12T06:08:24.257+0000] Pre-touch: Disabled
[2021-05-12T06:08:24.257+0000] Available space on backing filesystem: N/A
[2021-05-12T06:08:24.805+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:25.384+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:25.906+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:26.995+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.022+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.062+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.063+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.064+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.065+0000] Failed to commit memory (No space left on device)
[2021-05-12T06:08:28.066+0000] Failed to allocate initial Java heap (16384M)
 
Last edited:

Max

Administrator
Staff member
We checked ffmpeg RTSP publishing and WebRTC, RTMP playback by stream name on your server. All seems working:
1620803253262.png

I saw the following errors in gc-core log file:
The issue is fixed in build 5.2.944 which is available in AWS Marketplace by default now
1620803571939.png
 

Max

Administrator
Staff member
According to the log attached, you're publishing the stream named live
Code:
08:09:43,407 INFO            RestClient - API-ASYNC-pool-13-thread-6 SEND REST OBJECT ==>
URL:http://localhost:8081/apps/EchoApp/StreamStatusEvent
OBJECT:
{
  "nodeId" : "72wXQ5te0VSRhkeYMlIyTRLdfT0cVyzW@18.204.214.170",
  "appKey" : "defaultApp",
  "sessionId" : "/*.**.**.**:33001/***.**.**.***:554",
  "mediaSessionId" : "2194250e-a17f-4ae7-9c5d-0b62b897527e-live-RTSP",
  "name" : "live",
  "published" : true,
  "hasVideo" : true,
  "hasAudio" : true,
  "status" : "PUBLISHING",
  "audioCodec" : "opus",
  "videoCodec" : "H264",
  ...
}
but trying to play stream named test
Code:
08:09:58,226 INFO            RestClient - API-ASYNC-pool-13-thread-6 SEND REST OBJECT ==>
URL:http://localhost:8081/apps/EchoApp/playStream
OBJECT:
{
  "nodeId" : "72wXQ5te0VSRhkeYMlIyTRLdfT0cVyzW@18.204.214.170",
  "appKey" : "flashStreamingApp",
  "sessionId" : "/*.**.**.**:32777/***.**.**.***:1935",
  "mediaSessionId" : "test1/*.**.**.**:32777/***.**.**.***:1935",
  "name" : "test",
  "published" : false,
  "hasVideo" : true,
  "hasAudio" : true,
  "status" : "PENDING",
  ...
}
Perhaps you publish the stream as rtsp://server_ip:554/live/test, but WCS supports only RTSP URI to publish like rtsp://server_ip:554/test, so all the characters after the second slash are dropped, and stream is publishing as live
You should publish the stream as rtsp://server_ip:554/test, then it can be played as test.
 
Top