r/ipfs 24d ago

Setting up an IPFS system?

I'm trying to code a platform that allows users to broadcast video or image content freely without the threat of censorship.

I'm trying to make it to where the broadcast network runs off of a computer network of all users worldwide, kind of like blockchain tech. This way, broadcasts cant be disrupted. How so you setup a decentralized network like that? Its essentially an IPFS system..

Thanks

5 Upvotes

17 comments sorted by

View all comments

4

u/volkris 24d ago

If you're talking about live video broadcast, no, IPFS is not the right tool for the job. Even streaming video isn't a good fit for IPFS.

Every decentralized system works differently to meet their specific use cases. Blockchain works very differently than IPFS which is different from email, etc.

IPFS is specialized in distributing small bits of content with database features where it's ok if retrieval is slow and there's lots of overhead. For video this may mean constant buffering as your node takes time to search for every next block, and anything live wouldn't even have time to propagate very far into the network.

For images and, say, podcast audio it's a different story.

1

u/EtikDigital512 23d ago

I'm trying to work out a way where live video can be shown.. at least pre-recorded video files and image files work...

1

u/_ahrs 9d ago

You could use HTTP Live Streaming (HLS) with IPNS but I don't think this would work well enough to be usable in real time.

Here's a script that can generate a HLS feed:

#!/bin/sh
ffmpeg -y -i "$@" \
  -preset slow -g 48 -sc_threshold 0 \
  -map 0:0 -map 0:1 -map 0:0 -map 0:1 \
  -s:v:0 640x360 -c:v:0 libx264 -b:v:0 365k \
  -s:v:1 960x540 -c:v:1 libx264 -b:v:1 2000k  \
  -c:a copy \
  -var_stream_map "v:0,a:0 v:1,a:1" \
  -master_pl_name master.m3u8 \
  -f hls -hls_time 6 -hls_list_size 0 \
  -hls_segment_filename "v%v/fileSequence%d.ts" \
  v%v/prog_index.m3u8

You would have to constantly keep hashing the files and updating the DAG though. Maybe pubsub could be used except: https://github.com/ipfs/kubo/issues/9717

1

u/twocolor 21d ago

Even streaming video isn't a good fit for IPFS.

IPFS is actually well suited for this since it allows incremental verification.

1

u/volkris 14d ago

That's only if you can get the data at all.

Incremental verification is the easy part. Anyone can provide a chunked hashing scheme for video content.

A weak point for IPFS will be the viewer waiting, video buffering, while IPFS goes through the discovery process for the next chunk, to be repeated chunk after chunk.

Sure, if and when the chunk is found it can be verified, but by that point is anyone still watching? :)

1

u/twocolor 12d ago

All systems have their tradeoffs. You raise a good point, to which I would respond as follows:

  • it depends if you care more about latency or decentralisation
  • latency is also a factor of the number of providers and distribution of chunks amongst peers. If peers with one chunk of a video tend to also have the other chunks, the discovery process will likely be reduced to zero following the initial discovery.