Geek Freely: streaming

    Featured Post

    The whole point in this post is to run your own VPN service, and allow you to connect remote devices to your home network.

    To start off yo…

    Showing posts with label streaming.

    Showing posts with label streaming.

    So I finally decided to build a dedicated Plex Media Server, my desktop wasn’t cutting it.

    I used the following Plex link to educate myself about the system requirements.

    The Hardware

    Basically it stated that for every HD movie I wish to trans-code and stream I needed a passmark of about 2000.

    Check

    to determine your CPU passmark, and investigate what you need.

    I decided that at maximum I would have 3 simultaneous streams going on, of my home movies of course. All these streams being HD – factor in your network upload speeds when determining what you can handle.

    So, ballpark I needed a processor capable of about 6000 on the passmark scale – and I also made room for overhead.

    I went with the following processor which gave me a passmark around 7300.:

    Start with the processor then let this dictate the rest, I like to keep my systems small so I was looking for a mini-ITX that was LGA 1150 compatible. Please remember and check the CPU maker site to confirm motherboard (MB) compatability.

    The MB I chose in the end was:

    Mini-ITX means smaller case. I went with the following for simplicity.

    So I have my processor, my MB, my case. I added 4GB of RAM and a 120GB SSD. The solid state disk was a little large, since I won’t keep my movies locally. This is the RAM and HD:

    The Software

    So to keep things slick I decided to install Plex on Ubuntu, I figure any future services I want to run will no doubt work on Linux, that and I know Ubuntu. Check the official Plex site for more details on setting this up

    I installed Ubuntu Server, because I don’t really see a need for a GUI front-end, Plex is configured via the web. After installing Ubuntu Server, installing Plex is simple enough:

    Download the .deb package from . if you are putting it on a USB for installing on the Ubuntu Server, you may want to install usbmount to automount inserted USB sticks.

    sudo apt-get install usbmount

    Once you have the .deb package on your server, go ahead and install with the following command, relative to your .deb filename of course:

    sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb

    To setup the server, open a browser window, and go to http://127.0.0.1:32400/web, replacing 127.0.0.1 for the IP of the server if you are configuring this remotely.

    Setting Up NAS Shares

    The next thing you are going to want to do before getting involved with the configuration is map all your samba shares.

    You will need cifs-utils:

    sudo apt-get install cifs-utils

    I used the following link to work out my samba situation:

    Make a .smbcredential file in your home directory so you can map your fstab correctly. In this file put username and equals sign and the access username for the share (and domain if loging into a domain) on the first line, put password and equals sign and the password for that user account on the second line of the file. The file should look like:

    username=MyUsername

    password=MyPassword

    # OR:

    # username=MyUsername@MyDomain

    # password=MyPassword

    # OR: (for cifs on Windows Serve 2003)

    # username=MyDomain/MyUsername

    # password=MyPassword

    Edit fstab to map your mounts (sudo nano /etc/fstab). Entries in your fstab should look similar to the following:

    //master/install_files /path/to/mnt cifs iocharset=utf8,credentials=/path/to/.smbcredentials,uid=1000 0 0

    Where…

    //$SERVER/$SHARE $MOUNTPOINT $FS_TYPE credentials=$SMB_CREDENTIALS,uid=$UID,gid=$GID

    # e.g.

    SERVER=master

    SHARE=install_files

    MOUNTPOINT=/path/to/mnt

    FS_TYPE=smbfs

    SMB_CREDENTIALS=/path/to/.smbcredentials

    UID=1000

    GID=1000

    Once completed exit nano and save the changes to fstab. Make sure that the shares mount correctly:

    sudo mount -a

    If successful, reboot and make sure that mounts and Plex start automagically.

    Now configure your Plex shares! Enjoy.

    Firstly, I have to say I cannot take all the credit for this… I got a lot of information from , who in turn got it from NAS4Free wiki.

    However, I did find some problems along the way, and as usual I want to keep it somewhere I can get easy access to in future – this blog.  Please also note, this will solve any m4a and flac transcoding issues, and possibly other codecs.

    The whole process relies on you setting up a jail in NAS4Free so that the changes are not lost on reboot (since this is an embedded guide).

    Lets start of with configuring NAS4Free to complete this task:

    SSH into your NAS4Free box using putty or similar. NOTE: Change all reference to /mnt/data to the mountpoint on your NAS where you are going to store the jail.

    The base system has to be downloaded to make sure you get all

    the necessary binaries, config files and scripts. To download it you can

    just copy paste the following commands into the ssh shell.

    The last command for fetching lib32 is not needed if you are running NAS4Free on an 32bit system.  The following two commands extract the base system into the proto folder inside the jail.

    NOTE: Obviously exchange EST for

    your own time=zone. Next we will configure the mounts that the jail is

    going to be able to access.

    NOTE: Change DataDisk1 for the mounts that you have on the NAS

    that you want to be accessible in the jail.

    Copy into the fstab file the following lines:

    /mnt/data/DataDisk1 /jail/proto/mnt/DataDisk1 nullfs rw 0 0

    The drive is mounted read write for playlist, comments, ratings, podcast access from Subsonic.

    The next part of the

    configuration is to create the rc.conf file.

    Copy into the rc.conf.local the following lines:

    jail_enable=”YES” # enable jails YES|NO

    jail_list=”proto” # name of the jails to start “proto www…”

    jail_proto_rootdir=”/jail/proto” # path to our jail

    jail_proto_hostname=”proto” # hostname

    jail_proto_ip=”192.168.0.30″ # ip of the jail, replace with a ip in the same subsystem as your NAS

    jail_proto_interface=”re0″ # Network Interface to use, replace with your NAS interface name

    jail_proto_devfs_enable=”YES” # use devfs

    jail_proto_mount_enable=”YES” # mount YES|NO

    jail_proto_fstab=”/jail/conf/fstab.proto” # File with Filesystems to mount

    Copy into jail_start the following lines:

    #!/bin/tcsh -x

    #mounting to /jail

    mkdir /jail

    mount_nullfs /mnt/data/jail /jail

    # copy jail binaries to /usr, not needed if N4F is 454 or up

    # because Daoyama include needed files, uncomment if you use low .454 version

    # cp -r /jail/conf/root/ /

    # link config files to /etc

    ln -s /jail/conf/rc.conf.local /etc

    #start all jails

    /etc/rc.d/jail start

    Make the start-up script executable with the following command:

    And to make it run each time the NAS server is started, add the following via the webgui under System|Advanced|Command Scripts.

    Command: /mnt/data/jail/conf/jail_start

    Type: PostInit

    Save and apply, and reboot your server. After a successful reboot check your new jail via SSH using the jls command, you should see something like this:

    JID             IP Address                   Hostname                      Path

    1                192.168.1.201             proto                              /jail/proto

    And that’s how you setup a FreeBSD jail on NAS4Free embedded.

    Enter the jail with the following command (based on the output of example jls above we use 1):

    The pkg_add command doesn’t function

    properly inside the jail. To fix this you have to run the following

    command NOTE: I am using a 64-bit install:

    Now start installing the packages required by

    Subsonic:

    Now install libmp3lame so that ffmpeg can use it for transcoding:

    Now compile and install your own ffmpeg with libmp3lame enabled, (remember –enable-libmp3lame during make config):

    Create the folders and download/extract subsonic standalone.

    Enter the following

    command while you are still inside the jail to see if subsonic starts.

    If subsonic started as it should you can connect to it via the

    browser at the following adress: Jail-IP:4040, default username is

    admin, and password admin.

    To make it run each time the NAS server is started add via the webgui under: System|Advanced|Command Scripts.

    Command: jexec 1 /var/subsonic/standalone/subsonic.sh

    Type: PostInit

    Save and apply, and reboot your server. After a successful reboot you can check your Subsonic install via http://Jail-IP:4040

    If your Subsonic installation has problems with the audio (the java

    install couldn’t see your audio dev) install

    alsa-plugins via the following command:

    ENJOY!

    And if you want to access your new service on your android device, why not try out the official

    (4/17/2013 Updated for Subsonic 4.8)

    (5/10/2013 Updated based on fsbruva’s comments http://forums.nas4free.org/viewtopic.php?f=79&t=3166&p=19759#p19759)

    So I have about 3 machines in my house that function as HTPCs.  One of those systems I use with full blown blown Ubuntu and XBMC install from repo.  The other systems I use , I have this installed on an old NVIDIA ION system and a Rasberry Pi.

    I have also advised two systems, which I setup, to use Openelec.  which has a great price on it, I can only assume due to the fact that they are coming out with a new version…which !

    Some of the main benefits about openelec.

    The main reason I am not using this on my main media center is due to the lack of support installing .  This main system is used to serve my streaming music to web and mobile apps, therefore, until I have played about with installing Subsonic on NAS4Free or Openelec, I will stick with an Ubuntu system in my household.

    Some other options:

    I have an iPhone and I used to use an application called SimplifyMedia to stream all my music across the nets to my phone – freeing up space on the device.

    After about 4 months of using it, I guess, SimplifyMedia was acquired by Google and took their service offline, so I needed to fine a replacement.

    In steps

    (http://www.subsonic.org/pages/index.jsp), a great little service that can run on a variety of OS, including my FreeNAS box if I chose to.  I currently run Subsonic on my Ubuntu box, I have donated to the cause allowing me to use the API’s (when I say me, I mean I can use apps that use the API’s).

    Along with Subsonic, I use

    3.0 (http://isubapp.com/) currently on my iPhone, the whole thing has been such a success I bought the application for my wife’s phone.

    I am not going to go into the nitty-gritty here, but Subsonic allows you to access your music (and video to some extent) through an encrypted connection via the web or supporting app.  Once connected the user can access any of the folders available to subsonic, make playlists, rate tracks, and scrobble tunes to last.fm (apps have some limitations, but it is mostly catch-up to support APIs).  iSub allows me to see what others are playing as well as chat to them, once scrobbling is implemented I am laughing – oh and the caching feature of iSub is awesome too, along with the desire to implement video streaming!

    To implement the whole solution, will cost about $14.99 before tax, $10 (min) donation to Subsonic, and $4.99 for the iSub app – well worth it!

    So I have been thinking a lot about VPN, I want to securely access my home network and VPN is the best way to do that.

    As I have mentioned in previous post I use

    on my router.  This free software allows me to adapt my .  One of the variants out there for Tomato firmware allows me to run an

    server from the router.

    Using this

    I would have the ability to connect securely and become part of my network from anywhere in the world.  This got me thinking a little more…

    I have a small portable

    solution, running on Ubuntu, if I had a VPN server up and running on my router I could configure the VPN client on Ubuntu to securely connect and be part of my network – allowing me to stream my content securely/encrypted anywhere in the world!

    So I signed up to be notified about the

    beta, but I never received an email – today I went to check the site out for an update… the beta has been out since the 7th.  I have downloaded the deb on my Ubuntu machine and installed it:

    sudo dpkg -i “downloaded file name without quotes”

    Probably have dependency issues…

    sudo apt-get -f install

    Worth checking on a few updates…

    sudo apt-get update

    sudo apt-get upgrade

    Well, obviously I haven’t had a chance to check it out, but we will see – I am very interested in the social aspects of the application, but I am loving

    with

    right now!

    Update:

    So I played about with boxee for a short period, the beta is a much needed improvement, but I am not sure if I will switch to it from xbmc!

    Looks like developer is leaving FreeNAS behind due to limitations, and moving to a Linux based system called – which then later changed to .  Being somewhat excited about an update for future-proofing and allowing major development , I was happy to hear the developer taking steps – however, there could be some time before we see anything.

    For all you FreeNAS lovers out there, don’t worry, looks like

    is going to take over FreeNAS development.

    Myself, I am going to look into ….

    If you got the money to fork out – then drobo is your solution:

    So I put a video in a directory on my webserver for my brother to check out, and I wanted to test if he could download it, so I entered the link to check it.  To my surprise it started to stream it in my Firefox browser, it may even do it in IE, but I hate IE/ActiveX so I don’t use it.  To accomplish this streaming joy all you need to do is get VLC.

    When installing make sure you check Mozilla plugin (if you are a Firefox user, ActiveX for IE users I assume) and then enter the link on your webserver (fll pathname) to the file.  After a short time buffering your media should be streaming to your browser.  The streaming quality is all dependent on upload speed from your server, and download speed at your location – but in a pinch, you can watch your videos from anywhere.

    Obviously we are talking about home movies here, as it would be highly illegal to do this with copyright material – even is you own it.  Not only is it illegal, but your ISP may frown on your webserver and upload usage.

    Check your ISP limitations before you go doing this sort of thing, you don’t want letters through the door, or obscene bills!

    Update:  I guess you could probably do this to your iPhone too if you have the video in the correct format for it…

    Subscribe to:

    Labels

    Blog Archive

    Links

    Leave a Reply

    Your email address will not be published.