vod experience

Dani

Member
my player requires a manifest file(mfd)
for vod expeirence I understand I need to put the mp4 file in the media folder as specified in the properties file.
than I create stream using vod://sample.mp4 as the stream name.

how do I pass it to the player ? the player requires a manifest URI (www.wcs.com:8443/????????/manifest.mpd ? )

this is what I use:
player
 

Max

Administrator
Staff member
Good day.
Shaka player suppots DASH and HLS only:
Shaka Player is an open-source JavaScript library for adaptive media. It plays adaptive media formats (such as DASH and HLS) in a browser, without using plugins or Flash.
WCS support HLS playback. So, to play media file as VOD via HLS, you should:
1. Configure HLS playback in WCS settings:
Code:
# Disable transcoding
hls_player_width=0
hls_player_height=0
# Minimal playlist size is 2 segments fo Apple devices
hls_min_list_size=2
2. Play VOD live stream vod-live://sample.mp4 in any player by the following manifest URL
Code:
https://wcs:8445/vod-live%3A%2F%2Fsample.mp4/vod-live%3A%2F%2Fsample.mp4.m3u8
Please note than non-alfanumeric symbols and slashes :// must be URI-encoded.
 

Dani

Member
are you sure this is the right format (with the file name apears twice ?
I get 404 using
const manifestUri =
'https:/mywcsaddress:8445/vod-live%3A%2F%2Fsh49VID1693967.mp4/vod-live%3A%2F%2Fsh49VID1693967.mp4.m3u8';

with this code sample:
<!DOCTYPE html>
<html>
<head>
<!-- Shaka Player compiled library: -->
<script src="dist/shaka-player.compiled.js"></script>
<script type="text/javascript" src="flashphoner/flashphoner.min.js"></script>
<script type="text/javascript" src="flashphoner/dependencies/jquery/jquery-1.12.0.js"></script>
<script type="text/javascript" src="flashphoner/dependencies/js/utils.js"></script>
<!-- Your application source: -->
<script src="myapp.js"></script>
</head>
<body onload="init_api()">
<video id="video"
width="640"
poster="//shaka-player-demo.appspot.com/assets/poster.jpg"
controls autoplay></video>
<input type="button" onclick="connect()" value="PLAY"/>
</body>
</html>
<script>

var SESSION_STATUS = Flashphoner.constants.SESSION_STATUS;
var STREAM_STATUS = Flashphoner.constants.STREAM_STATUS;
var session;
function init_api() {
Flashphoner.init({});
}

function connect() {
session = Flashphoner.createSession({
urlServer: "wss://www.sexcamz.co.il:443"
}).on(SESSION_STATUS.ESTABLISHED, function(session) {
playStream(session);
});
}

function playStream(session) {
session.createStream({
name: "vod-live://sh49VID1693967.mp4",
display: document.getElementById("video"),
}).play();
}



</script>
 

Max

Administrator
Staff member
are you sure this is the right format (with the file name apears twice ?
Yes. The HLS URL should include stream name and manifest file name:
Code:
https://wcs:8444/streamName/streamName.m3u8
I get 404 using
const manifestUri =
'https:/mywcsaddress:8445/vod-live%3A%2F%2Fsh49VID1693967.mp4/vod-live%3A%2F%2Fsh49VID1693967.mp4.m3u8';
Please try to reproduce the issue in HLS VideoJS Player example. Modify the example code to embed Shaka player instead of Video JS player.
 

Dani

Member
how do I use this example ?
what should I put in each section -
WCS - just the URL or shuold I use specific port ?
stream name - just the file name or the entire string ?
Auth and Key ?
 
Last edited:

Dani

Member
using your example without setting auth/key got me the same 404 eerror on this url:


I have this on flashphoner.properties:

meida_dir = /var/showVideosNew
# Disable transcoding
hls_player_width=0
hls_player_height=0
# Minimal playlist size is 2 segments fo Apple devices
hls_min_list_size=2
# ice_tcp_transport=true

and I have this file in that folder:
-rw-r--r-- 1 flashphoner flashphoner 5613951 Jan 27 08:31 sh49VID1693967.mp4
 

Dani

Member
got it to work but for some reason:
a. startup time is very slow (this is a 5mb file, takes 11 seconds to start the stream.
b. the quality is very bad (any movement in the scene is jumpy) - played the mp4 file on vlc player and it's smooth.
c. sending that stream to shaka-player - I can only hear the sound, but no video (error 4022 on the console)
 
Last edited:

Max

Administrator
Staff member
a. startup time is very slow (this is a 5mb file, takes 11 seconds to start the stream.
VOD playback is started by keyframe, and HLS segments cut too. So you should provide a regular and relatively short keyframe interval in recording by three ways:
1. Add the following settings to flashphoner.properties file to provide regular keyframe sending every 2 seconds from browser while publishing a stream that is recorded:
Code:
periodic_fir_request=true
periodic_fir_request_interval=2000
2. Re-encode mp4 file to add keyframes every 2 seconds
3. Enable transcoding for HLS playback
Code:
hls_player_width=640
hls_player_height=360
and, additionally, enable FPS filter for smoother playback
Code:
video_filter_enable_fps=true
video_filter_fps=25
In this case, additional CPU resources will be required (1 CPU core per 4 streams 360p) and some tuning may be necessary. So we recommend to try first to ways before.
b. the quality is very bad (any movement in the scene is jumpy) - played the mp4 file on vlc player and it's smooth.
c. sending that stream to shaka-player - I can only hear the sound, but no video (error 4022 on the console)
The qulity issues also depend on source file keyframes and FPS, so they should be fixed as described above.
Also, this may be player channel bandwidth issues. Please check the channel between server and player using iperf, TCP channel should be tested because HLS always uses TCP.
 
Top