Repository navigation
What's the best way to add a transcoding middleware that convert HEVC to h264? #7390
Replies: 2 comments 1 reply
|
HLS.js is a streaming library meant to be used as a playback engine. It is not a vehicle for transcoding. Encoding should happen before packaging into HLS and delivering to clients running HLS.js. |
|
For anyone landing here later: the spot that doesn't require touching hls.js is one layer below it. Patch MediaSource.isTypeSupported/addSourceBuffer before Most of the work is in the proxy honouring the SourceBuffer contract: updating state, when updateend fires relative to the append-progress watchdog, and timestampOffset on repositioning. Get those wrong and hls.js is right to complain. I went that way rather than ffmpeg.wasm: a full ffmpeg build is heavy for this, and you still have to solve the SourceBuffer plumbing either way. https://github.com/lid-labs/hevc.js (disclosure: I wrote it). Three things worth knowing before committing to client-side transcoding, whatever you build it with:
|
Uh oh!
There was an error while loading. Please reload this page.
Hi there 👋
I'm relatively new to the world of codecs and HLS and I would like to ask for help on the following use case:
Given the current browser and hardware support I can't rely on having this hls stream be displayed in h265 at all times.
So, to workaround this, when Media source identifies that h265 can not be played, I was thinking of using
ffmpeg.wasmto transcode data, as it comes, to h264, for broader support.Question:
What's the best and most efficient place to integrate this logic using hls.js?
Thank you
All reactions