Publishing HLS, DASH or SmoothStreaming to Webdav, FTP and Samba


The encoder supports WebDav, FTP and Samba protocols to publish HLS, DASH and Smoothstreamingto some external servers. First you need to prepare your server. You can find some setup examples bellow.

1. Publishing to Webdav

Web Distributed Authoring and Versioning (WebDAV) is an extension of the Hypertext Transfer Protocol (HTTP) that allows clients to perform remote Web content authoring operations. The WebDAV protocol makes the Web a readable and writable medium. It provides a framework to copy, change and delete files on a web server. Simple Webdav sever you can setup on any Linux server. Here we provide an example of config for nginx:

server {
listen 80; ## listen for ipv4; this line is default and implied


location / {
root /var/lib/live;
client_body_temp_path /var/tmp;
dav_methods PUT DELETE MKCOL COPY MOVE;
create_full_put_path on;
dav_access user:rw group:rw all:rw;
allow 192.168.1.0/24;
deny all;
}


location /output {
alias /var/lib/live;
}
}

You should also add the following to http section of the nginx.conf file:

client_max_body_size 100m;

You can set full permissions to /var/lib/live folder also.

If you are going to publish live content we recommend locate this folder on RAM disk.

When your Webdav server is ready you should setup transcoder to publish on it. To set the default publishing path you should edit in the configuration file on the device \firmware\current\state.dat.

Transcoder has built-in Webdav server. By default transcoder is publishing to itself and parameter responsible for that is named “OutputDir”, default value is <OutputDir>http://localhost/output/</OutputDir>. In that case the chunks are stored in the RAM. That configuration (publishing to itself) is recommended for test purpose only. If you will be publishing many streams to RAM, it can become very fragmented and performance of the encoder will be reduced. For the best results we recommend to publish to an external WebDav server.

To get access to the transcoder’s console you can use any VNC client, we recommend TightVNC

Before you will edit file \firmware\current\state.dat first you should stop the transcoder console by pressing Ctrl+C. Pic.1.

Pic. 1

When both console windows will be closed you should edit “state.dat” file with Notepad. For example, if your Webdav server has address 192.168.1.10 you should edit “OutputDir” parameter in state.dat: <OutputDir>http://192.168.1.10/</OutputDir>

Save the configuration file. Now you may start the transcoder console, open Windows explorer and run \firmware\current\BeamControllerconsole.exe or just restart the device.

Open Web UI to setup your WebDav publication. Go to “Output streams” menu and click “add”/”edit” an output stream.

Choose a channel, templates and format (HLS, DASH or SmoothStreaming).

For “Output URL” field in an output stream setup you may enter only some name (for example the channel name) Pic.2

The full output URL will be created by combination of the parameter OutputDir from the configuration file state.dat and that name. Another option is set full URL in the “Output URL” field, for example http://WebDav_server_name/channel_name. When you set full URL with “http://” prefix, then the parameter OutputDir from the configuration file state.dat will be ignored.

Pic. 2

Click “Save”. Now you can start your channel from the “Channels” menu. If all settings are correct the channel in few seconds will have “Started” state.

URL for playing output stream you can see on the “Output streams” page. For our example it will be:

http://192.168.1.10/output/amedia_hd/playlist.m3u8for HLS format

http://192.168.1.10/output/amedia_hd/ output.mpd for DASH format

http://192.168.1.10/output/amedia_hd/ manifest.xml for SmoothStreaming format

 

2. Publishing to SMB

The Server Message Block (SMB) protocol is a network file sharing protocol that allows applications to read and write to files and to request services from server programs in a network. The SMB protocol can be used on top of its TCP/IP protocol or other network protocols.  Simple SMB sever you may setup on any Linux server. Here we provide an example of a config for Ubuntu server 12.04:

First we install samba:

sudo apt-get install samba

Samba config file is located /etc/samba/smb.conf, edit it to add the following:

[share_name]
path = /var/lib/live/output
guest ok = yes
writeable = yes
oplocks = no
level2 oplocks = no

You should set full permissions to the /var/lib/live/output folder. You can restrict the access to share folder by “hosts allow” parameter. If you are going to publish live content we recommend locate that folder on RAM disk.

Run service smbd restart.

Now you can publish form the transcoder to your server to the SMB path: \\IP_address_or_name\share_name\

To set the default publishing path for the encoder you should edit the config file on it \firmware\current\state.dat.

By default transcoder is publishing to itself to Webdav and parameter responsible for that is named “OutputDir”, default value is <OutputDir>http://localhost/output/</OutputDir>

To get the access to the transcoder’s console you can use any VNC client, we recommend TightVNC

Before you will be able to edit the file state.dat first you should stop the transcoder consoles by pressing Ctrl+C (See pic.1).

When both console windows will be closed you may edit “state.dat” file in the Notepad.

For example, if your SMB server has address 192.168.1.10 you should set “OutputDir” parameter in state.dat, as follows: <OutputDir>\\192.168.1.10\share_name\</OutputDir>
Save the configuration file. Now you may start the transcoder console, open Windows explorer and run \firmware\current\BeamControllerconsole.exe or just restart the device.

Open Web UI to setup your Samba publication. Go to “Output streams” menu and click “add”/”edit” an output stream.
Choose a channel, templates and format (HLS, DASH or SmoothStreaming).
For “Output URL” field in an output stream setup you may enter only some name (for example the channel name) Pic.2
The full output URL will be created by combination of the parameter OutputDir from the configuration file state.dat and that name. Another option is set full URL in the “Output URL” field, for example \\Samba_server_name\share_name\channell_name. When you set full URL with “\\” prefix, then the parameter OutputDir from the configuration file state.dat will be ignored.

To be able to play content from your Samba server you should make your share folder accessible via HTTP. You will need a web server on your SMB server also or should have some another setup with ability to access the content via HTTP. Here is an example of config for nginx HTTP server:

server { 

listen 192.168.1.10:80;
server_nameorigin.domain.com;
root /var/lib/live;
index index.html index.htm;

}

Now you can start your channel from the “Channels” menu. If all settings are correct the channel in few seconds will have “Started” state.
URL for playing output stream you can see on the “Output streams” page. For our example it will be:

http://192.168.1.10/share_name/amedia_hd/playlist.m3u8 for HLS format

http://192.168.1.10/share_name/amedia_hd/ output.mpd for DASH format

http://192.168.1.10/share_name/amedia_hd/ manifest.xml for SmoothStreaming format

If you make any changes for the channel, template or the output stream you should restart the channel on the channels page.

 

3. Publishing to FTP

Noisypeak encoders support publishing to FTP server as well. There is a lot of FTP of servers and we will not give any examples here how to setup a FTP server.
We assume that you already have a FTP server with authorization, for example ftp://192.168.1.10/.
In the same way as for WebDav and Samba publications you can setup <OutputDir> parameter in the stata.dat configuration file, for example: <OutputDir> ftp://login:password@192.168.1.10/</OutputDir>.

In the same way as for WebDav and Samba publications you can setup your output stream.
Go to “Output streams” menu and click “add”/”edit” an output stream.
For “Output URL” field in an output stream setup you may enter only some name (for example the channel name) Pic.2

The full output URL will be created by combination of the parameter OutputDir from the configuration file state.dat and that name.
Another option is set full URL in the “Output URL” field, for example:  ftp://login:password@192.168.1.10/channel_name.

When you set full URL with “ftp://” prefix, the parameter OutputDir from the configuration file state.dat will be ignored.