Tag: dxgi

MF SinkWriter写入示例失败

我正在尝试使用MediaFoundation将ID3D11Texture2D编码为mp4。 以下是我目前的代码。 初始化Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_LOW_LATENCY, 1); // Create the sink writer if (Succeeded(hr)) […]