Opened 3 years ago

Last modified 3 years ago

#4659 new enhancement

Support the MFX Dispatcher from Intel Media SDK

Reported by: TheTroll Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: qsv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The current implementation of QSV supposes that the MFX dispatcher will open the VA session.

This is true with the MFX dispatcher available on github, but this version does not work properly, specially when closing the session.

With the official MFX dispatcher from the Intel Media SDK package, FFMPEG needs to open itself HW accelerated VA session.

This can be done like this:
https://github.com/TheTroll/FFmpeg/commit/69bff7abfcd321a29c23606cec973b75314f3b94
+
https://github.com/TheTroll/FFmpeg/commit/725f96bf2c71406ec535b8fed5d5879ec32a9881

Change History (4)

comment:1 Changed 3 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords quicksync intel removed
  • Priority changed from normal to wish
  • Version changed from unspecified to git-master

comment:2 Changed 3 years ago by maf

The proposed patch is linux centric. There is no libva on Windows.

comment:3 Changed 3 years ago by TheTroll

Indeed...
Well you have the idea here, in Linux, this is how it works with the latest Intel MediaSDK

comment:4 Changed 3 years ago by GwenoleBeauchesne

I think you need to supply two ways of allocating the VA display: one from within FFmpeg (libavcodec), and another one handed over by the user (e.g. through some vaapi_context).

Next, if FFmpeg was to create the VA display handle, using an environment variable to derive the device name is a no-go. You have the option to use libudev to enumerate and pick an Intel device + VGA class device. You can also avoid libudev if you were to parse /sys/bus/pci/devices entries yourself and check for class = 0x030000, vendor_id = 0x8086 for Intel.

Last but not least, DRM render nodes are now also the preferred way, unless you really want to ultimately render frames through KMS for instance. A render node id is built as 0x80|i where i has a /dev/dri/card<i> counterpart. With udev, it's generally enough to match "renderD[0-9]*" devices.

Note: See TracTickets for help on using tickets.