Closed mourner closed 3 years ago
Addressed in https://github.com/mattdesl/mp4-h264/commit/7ffcba9baca72c9cd91afa75fa6b604850568237, thank you!
The H264 encoder only accepts YUV frames. When you call encodeRGB it will just do the conversion into YUV natively, which I assume is faster than doing it in JS, but there may be some special cases where you want to send YUV frames.
Might need to explore this a little more actually, and perhaps add a way to enable JS-side RGB to YUV conversion. YUV frames are much smaller than sending RGB(A), and an encoder that only needs to handle YUV will use much less memory.
One more thing that's not clear from the docs / examples alone:
This implies there would be a reason to convert RGB to YUV prior to encoding, rather than calling
encodeRGB
directly — if that's the case, what's the advantage of this? Woes the resulting video differ in any way?mediainfo
on theencodeRGB
-encoded resulting videos shows that it's YUV-encoded.Thanks in advance for any clarification on this!