wolenetz / mse-for-webcodecs

Explainer for additions to MSE API to support buffering and playing WebCodecs media
22 stars 1 forks source link

can you please provide a working example ? #1

Open tlecoz opened 3 years ago

tlecoz commented 3 years ago

Hello Google-engineers ! Thanks for all your hard work !

Can you please provide a working example that shows how to read a webm using MSE & Webcodec I tryed to do it by myself but it's hard to figure out the correct way to do it.

Thanks for reading

wolenetz commented 3 years ago

Can you please provide a working example that shows how to read a webm using MSE & Webcodec I tryed to do it by myself but it's hard to figure out the correct way to do it.

This particular feature is oriented at providing a way for an app to feed the MSE API with already-parsed media configs and encoded chunks in WebCodecs structures, rather than make the MSE implementation parse the raw bytestream for the media container fed by the app.

I'm uncertain about your specific use-case. You might need a WebM parser and demuxer, or possibly there might be something in MediaStreams + WebCodecs that might help. Or something else. Please provide a little more detail. Note that this feature doesn't make MSE emit WebCodecs objects, instead it allows MSE to ingest WebCodecs objects.

Perhaps the SourceBuffer introspection idea (see https://github.com/w3c/media-source/issues/259), augmented to return WebCodecs structures (not just metadata) might be a potential fit for your use case?

tlecoz commented 3 years ago

Hello ! Thank you for your message

What I want is pretty simple actually , but there is no example at all on the web ...

I just want to read a webm file with alpha channel using WebCodec.VideoDecoder in order to demux it and access to every frames.

I do not need MSE actually , what I really want is an exemple that open a webm with alpha channel in VideoDecoder.

I already tryed many things to get the frame of a webm with alpha channel programmaticly , but no one worked. This one for example doesn't work with my webms... https://github.com/jscodec/jswebm

I tryed another one but I don't remember the name (and it doesn't work neither...)

wolenetz commented 3 years ago

I haven't tried that JS library for WebM demuxing myself (nor other similar ones). Perhaps shaka-player might support your webm files, especially if they're repackaged for that toolkit (https://github.com/google/shaka-player/issues/560 might be a good starting point), though it's a player library that encompasses lots of other parts beyond demuxing. Also, there's a large group of web authors that use media APIs like MSE in interesting ways reachable on the video-dev slack. They would probably have some good info for you for webm JS demuxing.

tlecoz commented 3 years ago

I will check your link, thank you

guest271314 commented 2 years ago

Working example of playing back EncodedAudioChunk's written to a single file https://github.com/guest271314/WebCodecsOpusRecorder.

One issue is the timeline control at <audio> does not print correct currentTime after playback is ended then the currentTime is set manually at controls.