Avoid image conversion to NV12 if possible
Categories
(Core :: Audio/Video, enhancement, P3)
Tracking
()
People
(Reporter: chunmin, Unassigned)
References
(Blocks 1 open bug)
Details
Currently, WMFMediaDataEncoder
always converts its input video frames into NV12 before encoding them, since the encoder's input format is initialized to NV12 input. However, it looks like it's possible to set the input format to I420 (MFVideoFormat_I420
) and other formats when encoding data to H264: https://learn.microsoft.com/en-us/windows/win32/medfound/h-264-video-encoder.
In WebCodecs's usages, the most likely input format today is I420. Setting encoder's input format to I420 can avoid the unnecessary conversion and results to a better encoding performance.
Note that Chromium did the same decision with ours. The input sample is converted into NV12 format due to the same reason - initilaization sets input format to NV12.
Comment 1•8 months ago
|
||
hw encoders almost always operate on NV12 input, let's not change that for now, and get hw encoders working first.
Description
•