2

What I want to achieve -

  • I have some videos on HDD which I want to access on other devices which are on the same LAN (Say smartphone or tablets)
  • Use the Raspberry Pi as a server to show the list of videos
  • User clicks on video he wants to see and then streams to his device. But he should not be able to download the video.
  • There can be upto 30 users who will be streaming the videos

What I have thought of so far -

  • Run Apache webserver on Pi and have a website and embed all the videos available for viewing.

Questions -

  • Is that the best way to go about this problem? Is there a better way to achieve this?
  • Can Raspberry Pi sustain streaming to so many users simultaneously?
bluefalcon
  • 123
  • 1
  • 4
  • Yes Kodi (XBMC) on rpi2 can serve HD video with NFS/SMB or UPnP enabled.from an external drive or NAS. via wifi or wired connection http://kodi.tv/download/ – Mapperz May 16 '15 at 15:38
  • 1
    Kodi(XBMC) does not help with the requirement to be able to stream but not download. But that said - unless you implement some sort of DRM scheme, stream==download. – Phil B. May 16 '15 at 15:40
  • @Mapperz I already have OSMC (Kodi port for Pi) running on my Pi, in this scenario I connect it to my TV, but I want the Pi to host it over network for other devices. So how would I go about accessing the files from a tablet when I run kodi on Pi? – bluefalcon May 16 '15 at 15:43
  • @PhilB. What if I embed the video in a webpage? Can it still be downloaded? The link will not be visible to the user.. – bluefalcon May 16 '15 at 15:45
  • "Is that the best way to go about this problem? Is there a better way to achieve this?" -> There are lots and lots of ways to achieve this. The hardware is not all that relevant, though, it's the software, which is largely dependent on the OS, which on the pi is usually some variant of GNU/Linux. So when you are doing research, search for "linux", not "raspberry pi". General linux questions belong on Unix & Linux (hence off-topic). – goldilocks May 16 '15 at 15:45
  • @goldilocks I was hoping to use a raspberry pi since it would have a lower overhead than running it on a linux PC directly. Also I wanted to know if the Pi can handle streaming of multiple videos given its restricted HW. So I wanted to know if I could achieve this on raspberry pi, this should be the best place to get that answer right? – bluefalcon May 16 '15 at 15:49
  • @goldilocks - I think the OP's last question is relevant to rPi. And if he wants to stream to 30 people simultaneously, he has to remember that a) the ethernet on the rPi is shared with the USB in terms of bandwidth (so streaming via ethernet or Wifi from a USB-attached drive uses 2x the bandwidth of the original content) AND is limited to only 100Mbps, which leaves in real-life scenarios less than 1.5Mbps per client (assuming all have separate streaming needs from the USB drive) (100/30/2 = 1.5). I don't think it will give a very smooth experience to say the least :) – Phil B. May 16 '15 at 15:49
  • "There can be upto 30 users who will be streaming the videos" -> One relevant aspect of the hardware is that the pi's ethernet speed is limited to 100 Mbps (12 MB/s). If you use USB instead, you'll have to share that bus with whatever storage you presumably use (unless it is all on the SD card), and don't count on much more than that. – goldilocks May 16 '15 at 15:50
  • "this should be the best place to get that answer right?" -> Not really. The hardware specs of the pi are online, so you don't need to ask about that. Beyond that, this is purely a matter of what software you want to use, and the restriction there is, again, determined by your choice of operating system (none of which are unique to the pi). By analogy, if your desktop had an Acme motherboard and you wanted to do this with that, would you ask on an Acme mobo forum about how to set up internet streaming? – goldilocks May 16 '15 at 15:53
  • ...But I'll bow to public pressure (@PhilB.) – goldilocks May 16 '15 at 15:54
  • @bluefalcon http://www.htpcbeginner.com/configure-openelec-samba-share-raspberry-pi/ can access the pi videos (on SD card or attached USB Hard-drive) across the same network if enabled – Mapperz May 16 '15 at 21:16
  • possible dup question? http://raspberrypi.stackexchange.com/questions/12560/how-do-i-stream-movies-to-openelec-via-lan – Mapperz May 16 '15 at 21:37
  • [15 hours later...1 answer...by me] @bluefalcon Do you understand better the point I am trying to make now about appropriateness? You are better off asking the largest possible relevant audience -- not the smallest. I do not make a point of that issue because I want to be a cop or I am a mean and deranged person. – goldilocks May 17 '15 at 07:04
  • 1
    @goldilocks Sorry, had to run the other day and I didn't have internet access for a couple of days. I am not avoiding you! :) Yes, I understand what you are trying to say. The analogy sort of nailed it in. Oh btw, moderation is a tough and often thankless job :) Don't let stuff like this put you off.. – bluefalcon May 18 '15 at 15:09

1 Answers1

2

The easiest way to do this would be to use existing software dedicated to more or less this purpose. I think the major cross-platform protocol for such things is UPnP or DLNA, the latter being essentially an extension of the former.

In addition to Kodi, there are a variety of DLNA servers available for GNU/Linux; that is just one list and I am sure you can find others.

If you wanted to rig something up yourself instead, there is no end of approaches you could take. As per my earlier comments, there are a range of pretty much stock mainstream GNU/Linux distros for the pi -- the exact same OS's that account for (perhaps) most of the internet servers in the world, which would mean this question is more like, "What are all the possible ways of streaming video from an inet server?". It would make much more sense if you pick a methodology, any methodology, and then ask if it is feasible on the pi.

There can be up to 30 users who will be streaming the videos

If you really need to do that often (or even just occasionally), I think you will be better off investing in some heftier hardware than the pi.

All pi's have 100BASE-TX ethernet, meaning in theory up to 100 Mbps. Looking at this chart, one full HD stream is likely to be 5-10 Mbps. If, for sake of an arbitrary "reality factor", we halve the first number and use the high-end of the second one, you at best will be able to serve less than half a dozen people.

goldilocks
  • 58,859
  • 17
  • 112
  • 227