tomeshnet / ipfs-live-streaming

Like HTTP live streaming, but with IPFS which is maybe better?
GNU General Public License v3.0
449 stars 74 forks source link

Server components #2

Closed benhylau closed 6 years ago

benhylau commented 6 years ago

OBS device (on-premise)

IPFS publishing servers (data centre)

Dedicated HTTP gateways (data centre)

Archival servers (data centre)

Some of these could be physically the same server.

@ASoTNetworks you mentioned chunking could be done in the IPFS publishing servers? Is this consistent with you have in mind?

darkdrgn2k commented 6 years ago

chunking could be done in the IPFS publishing servers?

I would Chunk at the source before distribution. This way when added to ipfs they will be the same hases (ie no dropped udp packet). Otherwise there would be two different cimplete set of feeds depending on the m3u8 used

benhylau commented 6 years ago

Adding details about the OBS device (on-premise):

+------------------+             +-------------+            +--------------------------+
| HD Video Camera  | --(hdmi)--> | Elgato HD60 | --(usb)--> | Laptop running OBS       |
+------------------+             +-------------+            | - Streams to RTMP server |
                                                            |   for Internet stream    |
+------------------+             +-------------+            | - Records m3u8 + ts      |
| Presenter Slides | --(hdmi)--> | Elgato HD60 | --(usb)--> |   for IPFS stream        |
+------------------+             +-------------+            +--------------------------+
                                        |
                               (hdmi pass-through)
                                        |
                                        v
                                    Projector

*Make sure two separate USB buses on the laptop are used to avoid saturating the bus bandwidth

ASoTNetworks commented 6 years ago

My plan is to have a IPFS publishing server pull from RTMP and it will chunk using this command ffmpeg -i rtmp://server-hostname/stream/key -c copy -hls_time 10 LIVE.m3u8

On that IPFS server we can also SFTP / SCP to other IPFS enabled servers to spread the load.

benhylau commented 6 years ago

So there is no need to locally record HLS chunks at all? The only thing the local machine uploads is the RTMP stream, pulled by both Internet server and one IPFS server?

darkdrgn2k commented 6 years ago

That works and it'd probobly the easiest way of splitting the stream to multiple servers.

But I will point out that your adding a new single point of failure

The obs system is always one (if it's down no stream)

But now the rtmp service is now a second.

benhylau commented 6 years ago

After further discussions, OBS will be recording .mp4 files for local archiving, and streaming RTMP to be picked up by HTTP streaming servers and IPFS streaming servers. @ASoTNetworks will consume the RTMP stream on his HTTP HLS streaming servers (non-IPFS) and the IPFS servers will take that same stream to do all the IPFS stuff.

This repo will focus on the IPFS side, and leave what people want to do with the RTMP stream as an implementation detail. So the updated OBS device (on-premise) picture looks like:

+------------------+             +-------------+            +---------------------------+
| HD Video Camera  | --(hdmi)--> | Elgato HD60 | --(usb)--> | Laptop running OBS        |
+------------------+             +-------------+            | - Streams to RTMP server  |
                                                            |   for HTTP & IPFS streams |
+------------------+             +-------------+            | - Records mp4 files       |
| Presenter Slides | --(hdmi)--> | Elgato HD60 | --(usb)--> |   for local archiving     |
+------------------+             +-------------+            +---------------------------+
                                        |
                               (hdmi pass-through)
                                        |
                                        v
                                    Projector
benhylau commented 6 years ago

Mostly addressed in README but still unsure whether we will use Justin's server (with unmetred bandwidth) for ipfs mirror/gateway.

benhylau commented 6 years ago

We will use Justin's server as a mirror. Since README has everything documented and this ticket has outdated information, let's close this and refer to README.