0

I'm working on VideoDecoder from WebCodecs API to decode frames from a video source file. Problem is the frame format of the output from the decoder is browser dependent. In Mozilla Firefox, it outputs in BGRX format while in Google Chrome and Microsoft Edge, it is in NV12 format.

There is a copyTo() API provided on the VideoFrame object, but this causes additional overhead. If there is a way to just output it on a specific format, it would be faster.

Also tried to change the hardwareAcceleration param on VideoDecoder's config(), the format changed to I420 but this is not what I desire. :(

Please let me know if this is possible.

1
  • Your problem is unclear... It would be faster for what purpose (maybe display in browser)? Also not clear how you have an output array of NV12 data without using copyTo(). If done correctly, VideoDecoder should give you a VideoFrame object instead of some NV12 or BGRX data. You need to use copyTo() to read/convert the frame data into your other preferred format like BGRX. Not clear why it's an overhead. Commented Dec 2, 2024 at 14:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.