I want to play back a raw .h264 stream using the Webcodecs API and extract specific frames. It is saved as a .h264 file, essentially just the video data before being muxed into a .mp4 container format.
It should be possible to play this back using the new WebCodecs API. I fail at providing the avc1.64001e
VideoDecoder with the properly formatted EncodedVideoChunk. How can I do so? I know the resolution, framerate and frame count, but how do I take this information and create an EncodedVideoChunk from that?
I have a potentially gigabytes big local file, which I receive via:
const readableStream = this.data.file.stream();
const reader = readableStream.getReader();
How to feed this into VideoDecoder: decode()
?
I know you can let mp4box.js
handle the demuxing and providing of chunks. But I have the data already demuxed. So how do I overcome this step, besides muxing and feeding it through mp4box.js
, only to have it demux again?