Opened 3 weeks ago

Last modified 3 weeks ago

#7112 new enhancement

FFmpeg should support hwaccel to handle device lost issue

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

Description

I often face "device lost" problem when use hardware-based decoders and I believe others using hardware-based encoders/filters face the same problem.

For example, when the device lost, h264_nvdec (CUDA) decoder would give errors like this:

[h264 @ AVCodecContext] Error decoding a picture with NVDEC: 700
[h264 @ AVCodecContext] hardware accelerator failed to decode picture

There are many reasons may cause GPU device lost during its working such as

  • The graphics driver is upgraded.
  • The system changes from a power-saving graphics adapter to a performance graphics adapter.
  • The graphics device stops responding and is reset.
  • User manually disable or enable device.
  • A graphics adapter is physically attached or removed.
  • Remote access to the PC which could change display resolution.
  • Unplugging or plugging the monitor cable to the VGA adapter.
  • Etc.


Of course, not all reasons cause "device lost" always, some may happen to some kind of PCs but may not happen to others.

I would FFmpeg to provide a callback mechanism giving the API user a chance to reset or recreate
the hardware acceleration resources, or even switch to software decoder/encoder/filter if the device
can not be recovered.

Change History (1)

comment:1 Changed 3 weeks ago by cehoyos

  • Keywords hwaccel added; device lost removed
  • Priority changed from normal to wish
  • Version changed from 3.4 to git-master
Note: See TracTickets for help on using tickets.