Opened 8 weeks ago

#8036 new defect

avcodec_open2 with h264_qsv fails with "Internal error - this should not happen" on Windows 10

Reported by: pweber Owned by:
Priority: normal Component: undetermined
Version: 4.1 Keywords: API h264_qsv avcodec_open2 MSX
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: Using version 4.1.4 source built with both NVIDIA and Intel (MFX) libraries on a Windows 10 OS, when using the codec named h264_qsv: avcodec_open2 fails with "Internal error - this should not happen." Sample code attached.

How to reproduce:

encodingFormat = AV_PIX_FMT_QSV;
codec = avcodec_find_encoder_by_name ("h264_qsv");
avFrame = av_frame_alloc ();
encodingContext = avcodec_alloc_context3 (codec);
avFrame->format = encodingFormat;
avFrame->width = width;
avFrame->height = height;
swsContext = sws_getContext (width, height, framePixFormat, width, height, encodingFormat, SWS_BICUBIC, 0, 0, 0);
encodingContext->width = width;
encodingContext->height = height;
encodingContext->time_base = av_make_q (1, framesPerSecond);
encodingContext->bit_rate = bitRate;
encodingContext->gop_size = 30;
encodingContext->max_b_frames = 4;
encodingContext->pix_fmt = encodingFormat;

Other options:
zerolatency=1
slice-max-size=20000
ps=30000
threads=4
cabac=0
max_nal_size=30000
allow_skip_frames=1
slice_mode=dyn
preset=veryfast
profile=main

Now call avcdec_open2:
errNum = avcodec_open2 (encodingContext, codec, nullptr);
Results: "Internal Error - this should not happen".

ffmpeg version 4.1.4
built on Windows 10

Attachments (2)

FFMpegEncodingAPI.cpp (9.1 KB) - added by pweber 8 weeks ago.
Sample source code.
FFMpegEncodingAPI.h (2.4 KB) - added by pweber 8 weeks ago.
Sample header.

Download all attachments as: .zip

Change History (2)

Changed 8 weeks ago by pweber

Sample source code.

Changed 8 weeks ago by pweber

Sample header.

Note: See TracTickets for help on using tickets.