![]() Which lower end hardware? a nokia brick phone from the year 2000? Can you give a concrete example? I have a hard time believing that parsing the torrent metadata / index is anything more than trivial. I’ve put together some tooling to help with manifest annotation and I believe most video players have extension hooks that could be used to add in the new client behavior. The steps in bold are different than the typical live streaming setup today. WebTorrent already has prioritization mechanisms so the player’s segment fetching logic could retain priority. Under the covers, WebTorrent could fetch them from the web seed or peers that are available. Register and fetch those segment files with WebTorrent.Parse out the segments and associated BitTorrent metadata.Fetch the HLS or DASH manifest as normally.Pad the last piece with zeroes for the purposes of calculating the final SHA-1, if necessary. Add metadata to your manifests specifying their length in bytes and the concatenation of the SHA-1 hash of every 2^18 bytes.Bonus points if you lay things out sanely so your HTTP endpoints can be used as a web seed directly. Create a standard HLS or DASH live video stream.With those modifications in place, if you’re a live streamer you would: Existing video player libraries can use manifest-polling or any other existing method to discover new media segments and feed that info to WebTorrent as the stream progresses. Don’t bother sending bitfield messages for live streaming torrents, rely on have messages instead. ![]() Use sparse representations (like Map or sparse-chunk-store) for torrent.bitfield, torrent.pieces, torrent._store, torrent._hashes, and wire.peerPieces.It’s 53-bits total so that it fits within the exact integer arithmetic range for Javascript and the fields are ordered so that if you’re interested in piece N, you’re likely interested in piece N + 1. I’ve built a PoC that uses 1 reserved bit, 8 bits for a stream identifier (aka “rendition”), 32 bits for a media segment number, and 12 bits for a piece index within that segment. The composition of that identifier could be left up to implementations but using existing live video formats to inform the choice seems likely to play better with piece-selection algorithms like sequential downloading. Interpret pieceIndex as an identifier.More concretely, here are my proposed modifications to WebTorrent to support live delivery: If we reinterpret that number as a piece identifier (and relax some constraints about piece density), existing peer behavior starts looking applicable to a lot more scenarios. From the perspective of the peer protocol, however, a piece index is just a number. Torrents created from the traditional metadata assign piece indices sequentially based on file declaration order. Requests specify a piece index, a byte offset, and a length. Peers distribute content by exchanging request and piece messages in the peer protocol. Just like WebTorrent, it’s probably necessary for some client changes but to keep them to an absolute minimum. The idea here is similar: use the best parts of the BitTorrent and live streaming ecosystem so that it’s easy for existing, battle-tested clients and tools to adopt. WebTorrent uses the BitTorrent protocol because it’s already proven and hugely successful. ![]() The goal of this proposal is to enhance conventional live streaming with P2P. WebTorrent could flip that on its head and make live streaming more reliable as audiences surge. Live events are unpredictable and traditional scaling mechanisms aren’t designed for usage to spike by a factor of a million in the span of a few minutes. Live streaming could benefit enormously from a robust peer-assisted model. Workarounds exist ( “Is it possible to do live streaming with WebTorrent?”, for instance) but they have substantial drawbacks – torrents are either at a signficant delay or the timeframe for peers to assist in delivery is very limited. That makes BitTorrent (and consequently, WebTorrent) difficult to use with live media. The BitTorrent protocol assumes that files in a torrent are known ahead of time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |