✨
Features Documentation
  • Streaming
  • Sharing
  • Live Streaming
  • Download flow
    • Download Implementation
    • Fixed Merkle Tree
    • Validation (Merkle) Tree
    • Necessity of signature method
    • Resuming downloads
  • Stripe Payment
    • About Stripe
    • Reusable Stripe Flow
  • Upload flow
  • 🏆Challenge Flow
  • 🎭Reward & Penalty
    • 📈Rewards
    • 📉Penalty
  • 🚑Allocation Repair/Rollback
    • Repair
    • Rollback
Powered by GitBook
On this page
  • Live-streaming with CLI
  • Live-streaming with wasm.
  • Download live-streaming

Live Streaming

Continuous uploading of live user's media (webcam & audio) to the server.

PreviousSharingNextDownload flow

Last updated 1 year ago

Live-streaming with CLI

Use stream to capture video and audio streaming from local devices, and upload

The user must be the owner of the allocation. You can request the file be encrypted before upload and can send thumbnails with the file.

Parameter
Required
Description
Default
Valid values

allocation

yes

allocation id, sender must be allocation owner

string

encrypt

no

encrypt file before upload

false

boolean

localpath

yes

local path of segment files to download, generate and upload

file path

remotepath

yes

remote path to upload file to, use to access file later

string

thumbnailpath

no

local path of thumbnaSil

file path

chunknumber

no

how many chunks should be uploaded in a http request

1

int

delay

no

set segment duration to seconds.

5

int

stream

When we start a stream from CLI the localpath is where our live video file is stored (its size gets changed.). It is read segment by segment by ffmpeg, each segment is converted to the .ts video file, and stored in the remotepath. The number of seconds in each segment is specified by the delay.

Live-streaming with wasm.

Live video and audio are captured from the browser. The captured file is broken into segments is transcoded to the .ts video file using ffmpeg.wasm within browser. Each transcoded segment is then uploaded to the remotepath specified.

Download live-streaming

The video file is uploaded to the remotepath directory.

./zbox download --live --localpath ./tvshow/live.m3u8 --remotepath /stream --allocation $ALLOC

A live.m3u8 file is created where continuous download of the video segment takes place.

We can start playing it using

vlc ./tvshow/live.m3u8