Vod-live questions

Reebo

New Member
Hi,
2 question about vod-live

1) Can I create a playlist of mp4 file to streaming sequentially?
2) Can I load a vod-live or a playlist directly from url (on demand) without start a rest-api streaming?

Thanks in advance.

Marco
 

Max

Administrator
Staff member
Good day.
1) Can I create a playlist of mp4 file to streaming sequentially?
Unfortunately, no. You should concat the required files to the one using ffmpeg for example.
2) Can I load a vod-live or a playlist directly from url (on demand) without start a rest-api streaming?
Yes. You can play a VOD-live stream directly from browser as described here
1615258995555.png
 

Reebo

New Member
Thanks for the answers.
What, in your opinion, is the best way to run an mp3 playlist controlled by a web client on multiple web clients?

Many thanks for your support.

marco
 

Max

Administrator
Staff member
What, in your opinion, is the best way to run an mp3 playlist controlled by a web client on multiple web clients?
First, all the files should be converted to MP4 with the same codec (AAC), channels count (stereo), sample rate (48 kHz to prevent excessive resampling)
1. Set the following parameter in WCS configuration file flashphponer.properties
Code:
mixer_idle_timeout=10000
opus.encoder.bitrate=128000
2. When web client is connected and playlist is combined, create an audio only mixer for that client
Code:
POST /rest-api/mixer/startup HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist",
    "localStreamName": "clients_playlist",
    "hasVideo": false,
    "hasAudio": true
}
and play the stream "clients_playlist" in clients browser
3. Publish the first playlist item
Code:
POST /rest-api/vod/startup HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"vod-live://first_item.mp4",
    "localStreamName": "first_item"
}
4. Add the first item to the mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist",
    "remoteStreamName": "first_item",
    "hasVideo": "false",
    "hasAudio": "true"
}
5. Periodically check if first_item is finished to play
Code:
POST /rest-api/vod/find HTTP/1.1
Host: wcs:8081
Content-Type: application/json
 
{
    "localStreamName": "first_item"
}
This query will return 404 when stream is finished
6. Add the next item to the mixer and so on
7. When client stops the play back, stop the mixer
Code:
POST /rest-api/mixer/terminate HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist"
}
 

Reebo

New Member
Ok thanks!

and on client side, what’s player can I use for crossing browser esperience? (we serve more web clients)

can I play stream before it was publishing? (Starting automatically when moderator start playlist)
 
Last edited:

Max

Administrator
Staff member
and on client side, what’s player can I use for crossing browser esperience? (we serve more web clients)
There is Player example, please see its code on GitHub. You can build custom player based on the code.
can I play stream before it was publishing? (Starting automatically when moderator start playlist)
The stream should be published on WCS server before playing it, othewise client will receive an error.
 

Reebo

New Member
First, all the files should be converted to MP4 with the same codec (AAC), channels count (stereo), sample rate (48 kHz to prevent excessive resampling)
1. Set the following parameter in WCS configuration file flashphponer.properties
Code:
mixer_idle_timeout=10000
opus.encoder.bitrate=128000
2. When web client is connected and playlist is combined, create an audio only mixer for that client
Code:
POST /rest-api/mixer/startup HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist",
    "localStreamName": "clients_playlist",
    "hasVideo": false,
    "hasAudio": true
}
and play the stream "clients_playlist" in clients browser
3. Publish the first playlist item
Code:
POST /rest-api/vod/startup HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"vod-live://first_item.mp4",
    "localStreamName": "first_item"
}
4. Add the first item to the mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist",
    "remoteStreamName": "first_item",
    "hasVideo": "false",
    "hasAudio": "true"
}
5. Periodically check if first_item is finished to play
Code:
POST /rest-api/vod/find HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "localStreamName": "first_item"
}
This query will return 404 when stream is finished
6. Add the next item to the mixer and so on
7. When client stops the play back, stop the mixer
Code:
POST /rest-api/mixer/terminate HTTP/1.1
Host: wcs:8081
Content-Type: application/json

{
    "uri":"mixer://clients_playlist"
}
Hi Max,
all seems to works fine, but quality seems worse that direct vod streaming... It's correct?
 

Max

Administrator
Staff member
all seems to works fine, but quality seems worse that direct vod streaming... It's correct?
Please clarify how much worse? Are there some clicks, pauses and so on in mixer output stream?
Please check if you set opus.encoder.bitrate parameter as we recommended.
Also, check server CPU load using top for example. If CPU load is constantly high, consider to upgrade the server to more CPU cores (for example, from 2 cores to 4).
 

Reebo

New Member
the same vod, launched alone
Code:
"rest-api / vod / startup"
{ "uri": "vod-live: //output.mp4", "localStreamName": "test" }
feels great.
But
The same file added to the mixer, loses a lot of quality (bass, clarity)

Both play with same player.
ps. set opus.encoder.bitrate 128000 and some test with 256000 and 512000 same bad result.

Thanks in advance.
 

Max

Administrator
Staff member
We tested on latest WCS build 5.2.912 but did not found a viewable difference.
Please try to increase opus encoder complexity from 10 by default to 20 for example
Code:
opus.encoder.complexity=20
and check.
If this does not help, please provide SSH access to your server and a test file (put it to media folder) using this private form, we will check.
 

Reebo

New Member
I upgrade to 5.2.9.12 and set encoder complexity but it doesn't works.

I send you a private form.

Many Thanks
 

Max

Administrator
Staff member
Unfortunately, we cannot connect to your instance:
1615442427535.png

Please provide a working credentials.
 

Max

Administrator
Staff member
We checked the case on your server and reproduces the issue in our test environment. Seems like mixer audio output is playing always as mono.
We raised the ticket WCS-3098 to investigate this and let you know results here.
Also we recommend you to use audio only files for audio only streaming case, to prevent excessive video encoding and to decrease CPU load.
 

Max

Administrator
Staff member
Good day.
We increased mixer playback quality, but still playing as mono. Will let you know when find a fix.
 

Max

Administrator
Staff member
We fixed mixer audio output quality issue in build 5.2.919, please update and check. There is no significant difference playing your test file directly and in mixer.
 

Max

Administrator
Staff member
Good day.
We added the parameter to enable stereo audio support in mixer since build 5.2.922
Code:
audio_mixer_output_channels=2
Please update and check.
We also recommend to convert audio to sample rate 48000 Hz.
 
Top