6

Is there any easy way to locally stream media files over a network (to other Ubuntu machines)? I tried using ssh, but that's too slow for anything, and I can't figure out anything that would allow me to stream any video fast enough.

4
  • 1
    VLC Media player is my first go-to, what version of Ubuntu are you on? Oct 26, 2012 at 21:03
  • 12.10. I looked at VLC, but I didn't see an option that would allow me to just select a folder and be able to choose on the other machine. Did I miss that?
    – user99643
    Oct 26, 2012 at 22:29
  • 1
    I'm looking and I can't find if that would work or not, my Ubuntu machine is at the moment off the grid. I'll look further into it. Oct 27, 2012 at 0:39
  • Thank you! I'm still looking myself but nothing is fast enough (even though the network allows at least 720p with 5.1 audio).
    – user99643
    Oct 27, 2012 at 16:37

3 Answers 3

7
+50

I use lighttpd to make media accessible via HTTP, which is unencrypted (and therefore relatively fast), allows access control and is quite usable for streaming, although often underestimated for this purpose.

This is my lighttpd setup:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_auth",
        "mod_cgi"
)

cgi.assign      = ( ".cgi" => "" )

server.port                     = 8001
server.document-root            = "/home/shared/htvideo"
server.errorlog                 = "/dev/stdout"
server.dir-listing              = "enable"
dir-listing.encoding            = "utf-8"
index-file.names                = ( "index.cgi", "index.html")
include_shell "/usr/share/lighttpd/create-mime.assign.pl"

This brings up a small HTTP server on port 8001 which delivers content from /home/shared/htvideo. I got some self-written CGI scripts, to manage them, hence the CGI part in the configuration. But you can ignore that.

I use this to watch videos on my Android tablet without downloading them.

Whoops, you still need to start the service ;-)

Put this stuff into a configuration file (like .video_service), and run lighttpd -f .video_service.

After starting up the service tell your friends to point a browser to http://your.computers.ip.address:8001. They will see the list of files and can open each link directly with VLC media player, or totem or mplayer, Windows Media Player, or whatever. Most browsers even support to play MP4 videos (and sometimes other formats) by themselves nowadays.

4
  • 1
    This looks good. It's very late here here, but I'll try that right after I get home tomorrow. Thank you, this looks like it's a much better solution than the other things I found. I've learned that XBMC provides UPnP support OTB, but that failed 9 out of 10 times. Again, thank you.
    – user99643
    Oct 28, 2012 at 21:57
  • 1
    This works great, thanks! Just a question, can I safely leave this running at all times without worrying about it using too much of my cpu? Also, does this warrant that it can be accessed only over the local network?
    – user99643
    Oct 29, 2012 at 16:31
  • 2
    You can leave this running all time the CPU usage in idle is near zero, the memory usage probably very low. If you are in a network which is openly routed to the internet (your home network is normally not) you will want to configure some access control. See the lighttpd documentation for that. Oct 29, 2012 at 16:36
  • 1
    Thanks, I'll add this to startup then. It's great to be able to watch something on my laptop without the connection dropping every other minute!
    – user99643
    Oct 29, 2012 at 19:33
1

VLC. See this tutorial (it's for Windows, but I bet on Ubuntu it looks similar). Alternatively just google "VLC streaming".

2
  • 1
    "12.10. I looked at VLC, but I didn't see an option that would allow me to just select a folder and be able to choose on the other machine. Did I miss that?" – DoDoGo Oct 28, 2012 at 21:37
  • 1
    @Flabricorn That's why I'm linking to tutorial...
    – user31389
    Oct 29, 2012 at 10:00
1

Go with Paul's solution, but I used to use shared folders and samba.

Right-click, sharing options, share this folder, allow guest access. It's not strictly streaming of course.

Subsonic is a good solution if you don't mind paying a mandatory "donation". It is a media webserver which does on-the-fly transcoding for videos as well, which I used to use when watching over relatively low bandwidth (mobile, e.g. 3G) connections.

You must log in to answer this question.