[Libav-user] Black frames from dxva2 H264 decoder
mont3z.claro5 at gmail.com
Tue Jan 10 23:30:31 EET 2017
I'm implementing a H264 player using ffmpeg with dxva2 acceleration.
I've tried following the example supplied in ffmpeg_dxva2.c but I've
always got a black frame from the decoder.
After some research and poking around I found that (Note: all those
steps can be followed in ffmpeg_dxva2.c):
- dxv2_mode being selected was DXVA2_ModeH264_E
- DXVA2_ConfigPictureDecode* cfg_list returned by
IDirectXVideoDecoderService_GetDecoderConfigurations had two elements:
- one with ConfigBitstreamRaw = 1
- other with ConfigBitstreamRaw = 2
According to ffmpeg example the best_score configuration is the one
with ConfigBitstreamRaw equals 2 and according to MSDN documentation:
ConfigBitstreamRaw may be 0, 1, or 2.
0 - Picture data will be sent using macroblock control command
buffers. The DXVA_Slice_H264_Long structure is used for slice control
1 - Picture data will be sent using raw bitstream buffers. The
DXVA_Slice_H264_Long structure is used for slice control data.
2 - Same as 1, but the DXVA_Slice_H264_Short structure is used for
slice control data.
- ConfigBitstreamRaw = 2 returns a black frame (DXVA_Slice_H264_Short)
- ConfigBitstreamRaw = 1, returns decoded frame (DXVA_Slice_H264_Long).
I found that in dxva2_h264.c there is an implementation for
slice_short and slice_long. From all this I would expected
ConfigBitstreamRaw equals 2 to work just fine. I'm just puzzled why
not. Has anyone experienced this problem before? Is ffmpeg H264 Dxva2
with slice_short buggy? Is there a better way to define the right
decoder configuration than shown in ffmpeg_dxva2?
More information about the Libav-user