Opened 5 years ago

Last modified 4 years ago

#8036 new defect

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

Reported by: Patrick Weber Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: qsv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


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:

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 Patrick Weber 5 years ago.
Sample source code.
FFMpegEncodingAPI.h (2.4 KB ) - added by Patrick Weber 5 years ago.
Sample header.

Download all attachments as: .zip

Change History (3)

by Patrick Weber, 5 years ago

Attachment: FFMpegEncodingAPI.cpp added

Sample source code.

by Patrick Weber, 5 years ago

Attachment: FFMpegEncodingAPI.h added

Sample header.

comment:1 by Carl Eugen Hoyos, 4 years ago

Keywords: qsv added; API h264_qsv avcodec_open2 MSX removed
Version: 4.1git-master

There is no release support on this bug tracker: Is the issue reproducible with current FFmpeg git head?

Note: See TracTickets for help on using tickets.