

Video Streaming with RethinkDB Changefeeds - ndarilek
https://github.com/AtnNn/rethinkdb-stream

======
icholy
Is it possible to "backload" changes?

"Start the changefeed at timestamp `x`. Once it's caught up to realtime, keep
feeding me new ones"

~~~
atnnn
RethinkDB's `.changes()` command doesn't support this directly. Here is the
corresponding github issue:
[https://github.com/rethinkdb/rethinkdb/issues/3579](https://github.com/rethinkdb/rethinkdb/issues/3579)

The code in the demo does this by performing a separate `between` query.

------
fsaintjacques
Hah, Étienne, lord of hacks :)

------
StavrosK
I read the changefeeds post, but I don't think I understood exactly what
they're for. Would clients be talking directly to the database, or would a
persistent app worker block on database updates and then send this to the
client?

~~~
segphault
In a more conventional usage scenario, your application is responsible for
picking up updates from the changefeed.

You can see an example here of a node.js app using a changefeed to convey
updates to the frontend through Socket.io:
[http://rethinkdb.com/blog/realtime-cluster-
monitoring/](http://rethinkdb.com/blog/realtime-cluster-monitoring/)

Though, of course, you can also build things other than web apps. Here's a
simple IRC bot built with Go that also uses RethinkDB changefeeds:
[http://rethinkdb.com/blog/go-irc-bot/](http://rethinkdb.com/blog/go-irc-bot/)

~~~
StavrosK
I see, thanks. So you basically get a blocking message queue for free, which
is pretty cool.

------
discardorama
How does this compare with, say, using a Redis pub/sub queue? (Aside from the
hack value, of using a database like RethinkDB for the task)

------
iso8859-1
how many FPS and how much CPU usage?

~~~
atnnn
I told ffmpeg to use `-r 25` but the console output says `fps=7.6`.

I just put it together in a few hours to see if it was possible. Given the
unexpected interest in it, I'll put some more work to see where we can take
it.

------
curiously
obviously this isn't production quality or scalable but interesting. on the
topic of video streaming, could you build something like twitch.tv with this
type of tool? or are there other tech stacks at play in order to make video
broadcasting possible.

