
Be your own video hoster with Docker and Nginx - betablocker
https://datarhei.github.io/restreamer/
======
Animats
This isn't being your own video hoster. This is the input side for feeding the
live streaming feature of YouTube, etc. It's not a playout or distribution
server, where viewers get their video direct from your server. That takes more
bandwidth than you can pump through a Raspberry Pi or up most DSL lines. Also,
most ISPs don't like you running a server, and streaming video servers are
rather noticeable.

Being your own video hoster usually means renting a server in a data center
with serious bandwidth, or buying streaming service from some cloud
provider.[1][2]

[1]
[http://www.streamingvideoprovider.com/prices.html](http://www.streamingvideoprovider.com/prices.html)
[2]
[https://aws.amazon.com/cloudfront/streaming/](https://aws.amazon.com/cloudfront/streaming/)

~~~
dogma1138
I'm streaming from my home plexn box over my internet line even at 1080p the
limit is more often than not the internet I have on my portable device at the
moment.

Within Europe 1080p is mostly manageable sub 720 is doable even in Asia.

In have 40ish mbit upload capacity.

Never had complaints from my ISP.

~~~
frik
40Mbit _upload_ is common?

~~~
dogma1138
On residential fttc connections these days I would assume so.

~~~
Jamesbeam
It's not.

I live in Germany. I think we both can agree that I live in, if not the most
technically advanced country in Europe that people claim to have very high-
quality living standards.

We have about 81.2M citizens and 12.5M can use FTTC / Bandwith plans with
upload speeds of 10Mbit+

So about 15.39% of the population of Europes technically most advanced country
have access to FTTC.

To see how bad it is, I uploaded you a picture. The colored marks are cities /
parts of the country where citizens can get a connection with the quality you
claim as "common."

[http://i.imgur.com/qsAeRez.png](http://i.imgur.com/qsAeRez.png)

Also, keep in mind that those kinds of plans are expensive. A plan with
50Mbits upload costs about 40€ per month.

About 4.3M (5%) of the German population live from the german unemployment
benefits called "ALG II / Hartz 4".

That is 404€ a month for food, electricity, clothing, and everything else you
need to live from.

Which means for 4.3 Million people they'd need to spend 10% of their monthly
income on an FTTC connection.

You can see even over here in Europe 40Mbits upload is not quite common if
almost 85% of the population don't have access to it and 5% couldn't even
afford it if they wanted to.

~~~
dogma1138
>if not the most technically advanced country in Europe that people claim to
have very high-quality living standards

Germany shares it's place with the UK at the bottom of high speed internet
availability in Europe (I actually live in the UK but where i live OpenReach
(I'm leasing 2 OR truncated lines through IDnet), Virgin Cable are available
at their max speeds and very soon 1gig from hyperoptic will too).

FTTC is available throughout most of the UK
[http://maps.thinkbroadband.com/#!lat=50.50176004214942&lng=6...](http://maps.thinkbroadband.com/#!lat=50.50176004214942&lng=6.73187367968751&zoom=6&type=terrain&tbb-
fibre-speeds) many other EU countries are far far better off than the UK and
apparently Germany.

You only need between 5 and 10mbit upload to being able to stream 1080p,
neflix streams 1080p between 4000-5300 kbits based on the profile, Plex has
similar profiles depending on if you want to use transcoding or not.

>You can see even over here in Europe 40Mbits upload is not quite common if
almost 85% of the population don't have access to it and 5% couldn't even
afford it if they wanted to.

That's not exactly the case
[http://www.ispreview.co.uk/index.php/2015/10/mixed-uk-
result...](http://www.ispreview.co.uk/index.php/2015/10/mixed-uk-results-in-
eu-study-of-broadband-speeds-price-and-coverage.html) (these are peak figures
so they account for network congestion) most of european FTTx subscribers is
getting quite close to 40mbit in some countries, but as I said even 10mbit
upload should be sufficient for this purpose. Sure I don't expect people
living in remote areas with DSL to be able to stream 1080p but that's not
really a surprise.

As for the cost, what do the cost have anything to do with it? people who live
on unemployment cannot afford many other things, and if you are not employed
and living on social benefits perhaps deploying your own streaming service
from home should not be on top of your priorities as the computing power,
storage, and multiple client devices that are required for such service will
or should be out of your reach in the first place.

------
bambax
There's a typo on those links in the FAQ (restreamer is repeated):

[https://datarhei.github.io/restreamer/restreamer/wiki/dynami...](https://datarhei.github.io/restreamer/restreamer/wiki/dynamicdns_en.html)

should be

[https://datarhei.github.io/restreamer/wiki/dynamicdns_en.htm...](https://datarhei.github.io/restreamer/wiki/dynamicdns_en.html)

and

[https://datarhei.github.io/restreamer/restreamer/wiki/guide-...](https://datarhei.github.io/restreamer/restreamer/wiki/guide-
buy-hardware.html)

should be

[https://datarhei.github.io/restreamer/wiki/guide-buy-
hardwar...](https://datarhei.github.io/restreamer/wiki/guide-buy-
hardware.html)

(but on that page, all links point to a 404).

------
sandGorgon
Does anyone know if the nginx+Netflix sendfile changes in Freebsd can be
ported to Linux at some point?

------
unnikked
Awesome!

------
dschiptsov
Why should one put anything under Docker for production?

~~~
dschiptsov
Perhaps, chrooted environment is required for effeciently serving static
files, I don't know.

And of all apps - nginx, which has been designed to be self-contained
(process-isolation is good enough) and has almost zero external dependencies
(openssl and pcre, which are parts of any modern OS). I could understand the
idea to "containerize" that pile of Java crap with its 100500 maven
dependencies just in order not to touch it again, but nginx...

BTW, does Docker's "port mapping", which is, of course, has zero overhead, is
what one needs in front of nginx in production?

~~~
kevan
Nginx is only one piece of the puzzle for this app, check out the
Dockerfile[1].

[1]
[https://github.com/datarhei/restreamer/blob/master/Dockerfil...](https://github.com/datarhei/restreamer/blob/master/Dockerfile)

------
m00dy
Hej, What is the revenue model ?

~~~
toomuchtodo
Perhaps its just a cool project not trying to make money?

------
smegel
Does docker run on FreeBSD? Because it is crazy to run NGINX on anything other
than FreeBSD because of Linux's appalling bad async IO support. For all I know
Windows might be a better choice.

~~~
rubiquity
Aside from the thousands of applications using Nginx on Linux with fantastic
results. Yes, yes we know *BSD has a better networking stack than Linux. Now
that you're done letting everyone know how smart you are, please sit down.

~~~
smegel
> Aside from the thousands of applications using Nginx on Linux with fantastic
> results.

Citation needed. Name a big company using nginx on Linux to serve up lots of
static content.

> Yes, yes we know *BSD has a better networking stack than Linux.

Who mentioned anything about a network stack?

> Now that you're done letting everyone know how smart you are

Well given some people like you clearly don't understand the point I was
making I think justifies the comment in the first place.

~~~
nl
_Citation needed. Name a big company using nginx on Linux to serve up lots of
static content._

Facebook[1], Reddit[2], Wordpress[3]

[1] [http://venturebeat.com/2012/06/18/nginx-the-web-server-
tech-...](http://venturebeat.com/2012/06/18/nginx-the-web-server-tech-youve-
never-heard-of-that-powers-netflix-facebook-wordpress-and-more/)

[2]
[https://news.ycombinator.com/item?id=8244868](https://news.ycombinator.com/item?id=8244868)

[3]
[http://searchdns.netcraft.com/?host=wordpress.com&x=0&y=10](http://searchdns.netcraft.com/?host=wordpress.com&x=0&y=10)

