Video On Demand Service

goldanlove

New Member
Hi,
I want some clarification on video on demand streaming in flashphoner.
Actually I want to stream multiple recorded video in amazon s3. (For Example I added 6 Video File)
Now I want to stream that 6 file in my live stream without stopping my live stream.
For more Clarification I have some advertising video and I divided my 1 Hour seminar to four video.
Now I want to add advertisement between these videos.
I knew about joining all video and play it but I want to do it dynamically where I can decide which advertisement need to play based on viewer count.
So In a simple word I want to play recorded video in live stream which every user playing in my website.
I checked about video on demand service so need to clarify on this issue.
 

Max

Administrator
Staff member
Hello

You can use Mixer

REST API
1. Add your live stream (stream1) into the Mixer (stream2).

2. Play your live stream from the Mixer (stream2).

To insert ad

REST API
3. Remove your live stream from the mixer.

REST API
4. Create VOD-LIVE stream (stream3).

REST API
5. Add your VOD-LIVE stream3 into the Mixer (stream2).

To stop ad

REST API
6. Remove ad stream3 from the Mixer.

REST API
7. Add your live stream1 again.

As you can see, stream2 (mixed) is always being played without interruptions.
You just add and remove source streams from the mixer.

Mixer description on our website

Mixer docs

VOD docs

VOD S3 docs

So you can add and remove live/VOD streams into the mixer and manage your live/ad content. There is side effect. Mixer consumes a lot of CPU. It can take 2 physical cores per mixed stream.
 

goldanlove

New Member
Actually I have all recorded file in my aws S3 now I wanted to make one program where I can choose any file from my S3 bucket list and play in live stream without giving delay in between of playing one file and adding new file to stream.
In a simple world I wanted then I published stream with one file then I can dynamically change already recorded file in my live stream.Suppose I already recorder 5 minute video and then I want to add ads so I can push that ads file in live stream to play it.
I hope you understand my concern.
I checked two way streaming but when i clicked on publish for player it's gives me failed looks like it gives me error of no device found.
Can you able to give me more clarity on video mixing in live stream things?
 

Max

Administrator
Staff member
We are working on stream injection in ticket WCS-2654.
You can use mixer as a temporary solution:
1. Create a mixer
Code:
POST /rest-api/mixer/startup HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "localStreamName": "mixer1",
}
2. Publish a stream, then add it to the mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "stream1"
}
3. Play the mixer output stream mixer1 in browser.
To insert ad
4. Create VOD-LIVE stream from an MP4 file
Code:
POST /rest-api/vod/startup HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json

 
{
    "uri":"vod-live://sample.mp4",
    "localStreamName": "stream_ad"
}
5. Remove the stream stream1 from mixer
Code:
POST /rest-api/mixer/remove HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "stream1"
}
6. Add the stream stream_ad from mixer
Code:
POST /rest-api/mixer/add HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "stream_ad"
}
Now, ad is played in mixer output stream mixer1 in browser.
To stop ad
7. Remove ad stream from the mixer
Code:
POST /rest-api/mixer/remove HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "stream_ad"
}
8. Add the stream stream1 to mixer again
Code:
POST /rest-api/mixer/add HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json
 
{
    "uri": "mixer://mixer1",
    "remoteStreamName": "stream1"
}
9. Terminate VOD-LIVE stream if it is still alive
Code:
POST /rest-api/vod/terminate HTTP/1.1
HOST: 192.168.1.101:8081
content-type: application/json

 {
    "uri":"vod-live://sample.mp4",
    "localStreamName": "stream_ad"
}
 
Top