15

I have a headless Ubuntu 12.04 server. I have a lot of video on the server. Most of it is in x264 in .mkv. I have a Samsung Nexus phone, and a Nexus 7 tablet.

What are my options when it comes to streaming from the Ubuntu server to Android? I got smb up and running. Some friends of mine were talking about DLNA, the "Playstation media server" could be a solution?

5

On your Android Device you will have to install a DLNA client to be able to access media shares you have on your server.

On your server you will have to run a DLNA/UPnP server that makes the shares accessible. Your network settings need to allow UPnP and Multicast (check with your router).

There are several solutions for an UPnP server you can choose from. With MiniDLNA, a leightweight but powerful DLNA server we able to stream MKV, and x264 content. This application is my recommendation for running on a headless server.

We can install it from the repositories with

sudo apt-get install minidlna

For help on setting it up see: https://help.ubuntu.com/community/MiniDLNA

  • 2
    Worth noting would be that not every version of Android supports all kinds media formats. While newer devices with version 4.0+ support the most common formats, older versions and processors with limited feature sets may have issues here and there. On top of that device manufacturers can still mess up the platforms default format support. Of course Android offers players that do decoding in software, but thats mostly a workaround and costs battery life. developer.android.com/guide/appendix/media-formats.html – LiveWireBT Aug 29 '12 at 14:49
4

On your server:

  • Install minidlna: sudo apt-get install minidlna
  • Configure /etc/minidlna.conf

On your android devide:

  • Install bubbleupnp or any other dlna/upnp client
  • Select your server
3

Serving over plain HTTP

The simplest possible solution is HTTP in combination with an Android video player that can do HTTP streaming, such as VLC, MxPlayer, etc - just use any of the many available HTTP servers.

Here are some one liners.

Python 2.x

$ python -m SimpleHTTPServer 8000

Python 3.x

$ python -m http.server 8000

Twisted (Python)

First, install the twisted package if not already present with pip install -U twisted (pip3 install -U twisted), then:

$ twistd -n web -p 8000 --path .

After you start the web server, open the browser on your Android device and type the IP and port of your Ubuntu box e.g. http://192.168.1.123:8000

You can use ifconfig on Ubuntu to see the IP address.

A more extended list of HTTP oneliner servers: https://gist.github.com/willurd/5720255

  • This is epic dude – Tessaracter Oct 22 '18 at 19:23
  • This man deserves a medal (Or May be a bounty). The answer is epic simple – Tessaracter Oct 22 '18 at 19:23
  • very simple technique worked ! but not able to forward videos – Abhishek Kamal Mar 3 at 13:09
  • @AbhishekKamal: SimpleHTTPServer does not support range requests. If you need seek support for videos you might want to use github.com/danvk/RangeHTTPServer or other, more advanced servers. – ccpizza Mar 4 at 9:54
  • After trying python -m SimpleHTTPServer 8000 i found that i can't seek videos so i stopped python -m SimpleHTTPServer 8000 and used an another trick, The trick is.... whenever i want to stream videos from laptop to android, i use smplayer (video player, newest version 19.1.0) in laptop, it provides a barcode, then i scan that barcode from the phone and i success to seek videos. And I found that, this method is working faster than previous. – Abhishek Kamal Mar 11 at 11:51
2

For media streaming using the UPnP media server specifications, I would look at:

  1. Mediatomb - runs in the background serving media, has a web interface which you can use to build the library.

  2. Kodi - normally used as a client, but you can enable media serving under the Network options within it.

You can find both in the Software Center.

As far as Android clients go, there are ports of both VLC and Kodi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.