generic questions

Gabriel T

Member
Hello
i have a few questions:
performance: how many concurrent live streams can we expect on such machines: 64G ram, 8cores, 1t bandwidth. with wowza i can easily get 1000 concurrents connection, what can we expect with WCS5 ?

not related to WCS directly: for conferencing app, i would need to store some datas (chat history, current speakers etc...) . on wowza this is done with sharedobjects, which approach would you recommend when working with WCS5 ?

screen sharing: i've developped my own screen sharing app using adobe air and ffmpeg. how could i use this app to stream from ffmpeg to WCS5 and then play the stream using webrtc ?

thank you
 

Max

Administrator
Staff member
how many concurrent live streams can we expect on such machines: 64G ram, 8cores, 1t bandwidth. with wowza i can easily get 1000 concurrents connection, what can we expect with WCS5 ?
If no video transcoding used, WCS should handle similar number of connections.
You can launch load test from another server:
https://flashphoner.com/docs/wcs5/w...g-load_testing-load_from_different_server.htm
not related to WCS directly: for conferencing app, i would need to store some datas (chat history, current speakers etc...) . on wowza this is done with sharedobjects, which approach would you recommend when working with WCS5 ?
WCS uses REST Methods (Hooks)
https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-methods/
So if user sends a data or if user publishes a stream, all this information will be sent to your web URL over REST / JSON.
Based on this you can gather all events (connect, disconnect, play, stop, stream status, connection status, sent message, sent data, etc) on your back end.
 

Gabriel T

Member
thanks for reply. about the data question, it was more about how to store these datas rather than sendind them. thought about saving sessions with memcache but for some reasons not fan of this option. the idea would be for each room to store current state and other infos. of course dont want to use database for this, but im not sure if php session would do the trick...if anybody have any idea
and about my other question, is it possible to stream from ffmpeg (in rtp or rtsp for example) and then play it back with webrtc in browser. or maybe i missed it, but would it be possible to grab a rtmp stream from a wowza server and play it back with webrtc ?
thank you !
 

Max

Administrator
Staff member
the idea would be for each room to store current state and other infos. of course dont want to use database for this, but im not sure if php session would do the trick...
You can test default sample:
https://host:8888/demo2/video-chat
As ou can see from logs/flashphoner-manager.log
All request are sent to:
http://localhost:9091/RoomApp/connect
http://localhost:9091/RoomApp/ConnectionStatusEvent
http://localhost:9091/RoomApp/publishStream
etc
So you can create your own php application
http://yourhost/RoomApp/connect.php
http://yourhost/RoomApp/ConnectionStatusEvent.php
http://yourhost/RoomApp/publishStream.php

WCS will send data to your PHP scripts.
You can either
1) save state
2) invoke original scripts
http://localhost:9091/RoomApp/connect
http://localhost:9091/RoomApp/ConnectionStatusEvent
http://localhost:9091/RoomApp/publishStream
etc
 

Max

Administrator
Staff member
and about my other question, is it possible to stream from ffmpeg (in rtp or rtsp for example) and then play it back with webrtc in browser. or maybe i missed it, but would it be possible to grab a rtmp stream from a wowza server and play it back with webrtc ?
1. You can publish a stream from ffmpeg using RTMP and then play back in WebRTC browser.
2. You can grab (pull) RTSP stream from Wowza. Example: rtsp://wowzahost:1935/live/stream1 and play in WebRTC browser.

You can't
1. Publish to WCS using rtp/rtsp from ffmpeg
2. Pull rtmp stream and play in WebRTC browser.
 

Gabriel T

Member
hello thank you for reply
maybe could be interesting feature to implement in the future to make this data stuff easier, to be able to save directly datas to a room object server side, something that would look like room.datas['myData1'] = "xxx"
 

Gabriel T

Member
about this answer: 1. You can publish a stream from ffmpeg using RTMP and then play back in WebRTC browser.

it looks like this is what i need, but i cant get it to work. how could i achieve this ?

thank you
 

Max

Administrator
Staff member
This works in our tests:
Code:
ffmpeg -re -i /tmp/sample.mp4 -preset ultrafast -acodec aac -strict -2 -vcodec libx264 -f flv rtmp://wcs5-eu.flashphoner.com/live/stream2
Then you can play the stream2 in the default WebRTC player
Example:
https://wcs5-eu.flashphoner.com/demo2/player
 

Gabriel T

Member
unfortunately not working (at least for screensharing. its working fine with local mp4 video). im using the following settings for ffmpeg (it is for screensharing using gdigrab, with adobe air app. This command is the same i'm using when streaming to wowza):
args.push("-rtbufsize","2000M","-f","gdigrab","-show_region","1","-video_size",""+screenSize+"","-draw_mouse","1","-framerate","5","-i","desktop","-vf","scale="+screenInfos2.bounds.width+":-1","-b:v","512k","-r","5","-f","flv","rtmp://" + server + "/live/SD1");

stream is published, but apparently no video is detected:
10:24:46,090 INFO agerRemoteRmiService - RMI TCP Connection(1965)-198.245.61.176 RECEIVED REST OBJECT <==
URL:http://localhost:9091/EchoApp/StreamStatusEvent
OBJECT:
{
"nodeId" : "EeO7VvKktOzOxHJ6yqBqXqOAEHrYQwOC@MY_IP",
"appKey" : "flashStreamingApp",
"sessionId" : "5fb111b1-53b1-4c2c-ba83-95b9db36121b",
"mediaSessionId" : "a8287efb-6953-43f1-9952-5a067ab81529",
"name" : "SD1",
"published" : true,
"hasVideo" : false,
"hasAudio" : true,
"status" : "PUBLISHING",
"audioCodec" : "speex",
"videoCodec" : "H264",
"record" : false,
"width" : 0,
"height" : 0,
"bitrate" : 0,
"quality" : 0,
"mediaProvider" : "Flash"
}
 
Last edited:

Max

Administrator
Staff member
Code:
args.push("-rtbufsize","2000M","-f","gdigrab","-show_region","1","-video_size",""+screenSize+"","-draw_mouse","1","-framerate","5","-i","desktop","-vf","scale="+screenInfos2.bounds.width+":-1","-b:v","512k","-r","5","-f","flv","rtmp://" + server + "/live/SD1");
It looks like a screen capture using ffmpeg.
Please describe step by step how to perform this streaming.
Should we install ffmpeg on Windows or on Linux to get this working?
Should we install another software based on ffmpeg?
 

Gabriel T

Member
ok finally found the correct command (need to convert to yuv 420):

ffmpeg -rtbufsize 2000M -f gdigrab -show_region 1 -video_size 1920x1080 -framerate 5 -i desktop -pix_fmt yuv420p -vf scale="800:-1" -b:v 512k -r 5 -vcodec libx264 -f flv rtmp://mywcs5server:1935/live/stream2

amazing !
 

Gabriel T

Member
well, its pretty inconsistant...the connection regularly drop, and when its working the latency is huge.

u can test on windows machine, using a ffmpeg binary, with this command line:

ffmpeg -rtbufsize 2000M -f gdigrab -show_region 1 -video_size 1920x1080 -framerate 5 -i desktop -pix_fmt yuv420p -vf scale="1024:-1" -b:v 512k -r 5 -preset ultrafast -vcodec libx264 -f flv rtmp://wcs5serveradress.com:1935/live/stream2

would love to know your results

thank you !
 
Last edited:

Gabriel T

Member
to give you more details: i'm using ffmpeg from an adobe air app for screen sharing. was using this app i made with wowza, and its very stable and with low latency. on wcs5, connection is dropped after a few seconds or max 1 minute. considering that this problem doesnt happen when streaming to wowza, i guess there is something on wcs5 that create this issues.
note that for the moment wcs is installed on a basic server, with not lot of ram and processor. could it be related ?
maybe can you provide me an address of one of your server with higher performances so i can test to stream to it and see if this connection problems occurs
 

Gabriel T

Member
this is the error i get from ffmpeg when the stream stops:
WriteN, RTMP send error 10053 (77 bytes)B time=00:00:42.40 bitrate= 208.8kbits/s dup=0 drop=2
WriteN, RTMP send error 10053 (38 bytes)
WriteN, RTMP send error 10038 (42 bytes)
av_interleaved_write_frame(): Operation not permitted
[flv @ 00000000050891c0] Failed to update header with correct duration.
[flv @ 00000000050891c0] Failed to update header with correct filesize.
 

Max

Administrator
Staff member
WriteN, RTMP send error 10053 (77 bytes)B time=00:00:42.40 bitrate= 208.8kbits/s dup=0 drop=2
WriteN, RTMP send error 10053 (38 bytes)
WriteN, RTMP send error 10038 (42 bytes)
av_interleaved_write_frame(): Operation not permitted
[flv @ 00000000050891c0] Failed to update header with correct duration.
[flv @ 00000000050891c0] Failed to update header with correct filesize.
To get this working you have to enable keep alives for websocket protocol only.
Config server.properties
Add line
Code:
keep_alive.enabled=websocket,rtmfp
Here you enable keep alives for Websocket and RTMFP protocols.
Keep alives for RTMP will be turned off.
Therefore WCS will not send RTMP keep alives to ffmpeg and will not terminate the RTMP connection.

Restart WCS server to apply keep alive settings
Code:
service webcallserver restart
 

Max

Administrator
Staff member
Regarding latency,
When we test, fps seems too low, about 1.8 fps.
Perhaps it is a cause of huge latency. At least the same latency when we play stream over RTMP.
 

Attachments

Gabriel T

Member
cool, looks like its working better. still have between 10 and 15 seconds latency. i guess it is because stream is transcoded and my machine is not very performant.
so now final question about this: i need to "mix" this screen sharing feature in video conferencing. and the rtmp stream is not linked to a room. how rooms are working compared, again, with wowza ? in wowza you can define an instance with appName/instanceName. is it the same with wcs5 ? if i create a room called "myRoom", is this instance available at live/myRoom ?

not sure if im clear. said differently,i need to be able to send information to the room that a screensharing stream is available, so it would be great to detect the publish event of the screensharing in a specific room. any idea ?
 

Gabriel T

Member
or, after increasing the framerate to 30, the latency is now inferior to 3s, which is satisfying considering this is a dev machine.
however, it seems there is a little issue in the transcoding process: the stream is a bit "choppy". more precisly it looks like the video makes some "backward" of a micro second, resulting in this strange choppy effect. didnt see this behavior with my app using wowza, so maybe there is a fix to apply to transcoding. did u notice the same behavior during your tests ?
 
Top