Mede8er Forum

Mede8er Products => MED600X3D / MED1000X3D / MED800X3D => Tips, Tricks and Tutorials => Topic started by: jer1956 on December 21, 2016, 12:16:30 PM

Title: Stream movie collection over the internet using IPTV
Post by: jer1956 on December 21, 2016, 12:16:30 PM
Libresonic comes with subsonics transcoding server for free. Have managed to get it to create an m3u8 for a movie collection which gets them transcoded in real time and streamed as .ts  Need a h265 example from somewhere to test. The movies tested so far have been mkv clones of bd using makemkv.

Some may think....what about those without Windows? Libresonic is java, and supplied as a java war. It needs a host java app server. Those are available for all operating system.  I can't describe how it's done for Linux or Mac's.  I just described what i did to run a java app server on Windows in the zip readme.
Title: Stream movie collection over the internet using IPTV
Post by: jer1956 on December 22, 2016, 08:38:39 AM
First thing is install libresonic on the PC which will become the server. To help Mede8er1 i have put everything needed to get Libresonic working in a zip, with instructions. This is for 64 bit windows.

You may have a firewall running on the host PC. You need to port forward 8080 through that firewall. That was automatic with Norton Security. Mede8er1 had to change Windows Firewall manually.

Once running as the Admin, got to Libresonic Settings /Users...and create a new User with Admin privileges. Log out, and back in as them.

Go to Libresonic Settings / Network. Select Automatically configure Router.

Go to Libresonic Settings / Transcoding. Use the Add Transcoder input to create a new Transcoder

Name.                            Convert From                                              Convert To   
vod    avi mpg mpeg mp4 m4v mkv mov wmv ogv divx m2ts                     ts       

                                                   Step 1
ffmpeg -ss %o -i %s -c:v libx264 -preset medium -crf 5 -maxrate %bk -bufsize %bk -s 1920x1080 -c:a ac3 -ac 6 -ab 448k -f mpegts -threads 0 -

This produces a Sat/Cable HD TV quality stream with Dolby Digital Surround.

This is where reality has to be accepted. If your stuck with ADSL, then a 1 meg upload rate is next to useless. If you want to try..change the maxBitrate to 400 as described further down. This is a game for those with VDSL or full fibre optic.

Go to Settings / Media Folders. Add the host folder for your movies. This assumes they are on the PC. Other places will have to be tested. Select Scan media folders now.

Go to Settings / Players. This lists instances of players that have been connected. Each user gets an instance for each player client player they use. It can mount up quickly. You should just have Player (Admin), and Player (your user name). Make sure it's the latter shown. Scroll down to the enabled transcoders. Disable flv and mkv, and select vod. Scroll back up, and select External Player with Playlist.

Now Logout (top right), and log back in. Some changes only take effect on the next log in. Select Videos, under the Libresonic Logo. You should have a very long list......
Now select the Play icon on the first movie. The server should now create an m3u playlist, which may take some time. When ready, the browser will ask if you want to Open it , or save it. Select Save.

At this point you can test it using a PC Media Player which understands m3u video playlists. You guessed it...VLC. But first we need to set the bitrate via the stream commands in the m3u. The default rate is 2000k, if the m3u is not modified this way. Using Wordpad, do a Global Find and Replace..change:-

You can have mutiple iptv files, with different rates. For LAN, very high, for WAN...2048. There is no need to do the next step for a LAN optimised iptv. .

Any kind client/server system over the internet is best done using using a domain url, not IP. So sign up to a free DDNS service. Every time your modem reboots you will get a new WAN ip. The DDNS will then update to map that to your fixed domain name.  The iptv file will not need changing, well only when your collection changes.  Here is the service i use:-

After testing the supplied version using LAN ip, open the m3u again with WordPad. Find every instance of the lan IP for the libresonic host, and replace with the WAN  DDNS domain name. So replace something like:-
with something like:-

Test the modified m3u with VLC.

With View Extensions enabled, rename Play.m3u to Collection.iptv. Copy the iptv to the X3D, and select via Media Library. You should get Added Successfully. Go to Internet Services....IPTV. Select Collection.
You should have a very long list to choose from.

Title: Re: Stream movie collection over the internet using IPTV
Post by: jer1956 on December 22, 2016, 12:13:42 PM
Have an X3D connected by wi-fi to a 4g mobile router. That has a 12 mbps download speed, and is streaming the 4 mbps movies via the internet. The source is my PC connected to the internet via VDSL with an 18 mbps upload speed.

Using the medium libx264 setting is really testing my PC cpu. All 8 cores at 60%. The normal real time setting would be superfast.
Title: Re: Stream movie collection over the internet using IPTV
Post by: jer1956 on December 22, 2016, 01:06:06 PM
Have copied the Skyfall 4K UHD Trailer into my test folder. Had it streaming as well, real time transcoding to h264, and down scaling to HD. That is why size is there as a transcoder paramater.

I am tweaking the settings based on using the 4g router, and monitoring the server output bitrate. So i have upped the quality to best setting before transcoding is disabled, and lowered the maxbitrate. That setting is's actually the average bitrate for each buffer created. So 4k was creating peaks over 7k.

One item i wasn't monitoring was server cpu load. It was maxing out. So tweaked a bit more. Now have less peaks and troughs in both lan and cpu loading, and no CPU clipping.
Title: Re: Stream movie collection over the internet using IPTV
Post by: jer1956 on December 23, 2016, 09:29:59 AM
Have changed to passing the maxbitrate as a parameter. It wasn't added by the libresonic playlist creator. It has to be done manually using WordPad. The transcoder command changes as well...see guide above.