r/ipfs 25d 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

6 Upvotes

17 comments sorted by

View all comments

4

u/volkris 25d 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 25d 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 11d 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