Opened 3 years ago

Last modified 4 months ago

#6495 open enhancement

Add low latency mode in nvcuvid/nvdecode

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


When I use h264_cuvid, it takes 4 extra frames to pass before it returns the first frame. So, this decoder is not usable for low latency application.
After browsing the NvDecode? API, there is a parameter to manage the number of extra frames: ulMaxDisplayDelay

This value is hard-coded in FFmpeg to 4, see libavcodec/cuvid.c line 980:

ctx->cuparseinfo.ulMaxDisplayDelay = 4;

It would be useful to add a 'low latency' option in FFmpeg to set the parameter ulMaxDisplayDelay to zero (no latency).
For example, an equivalent mode already exists when using QuickSync:

av_dict_set(&m_opt, "async_depth", "1", 0);

Thank you

Change History (4)

comment:1 follow-up: Changed 3 years ago by heleppkes

The decoder would be terribly slow without this delay, fwiw.

comment:2 in reply to: ↑ 1 Changed 3 years ago by abrevet

Replying to heleppkes:

The decoder would be terribly slow without this delay, fwiw.

I tested my application with ulMaxDisplayDelay = 0 (HD definition), and I have not seen low performance.

It would be useful to let the choice to the user.

comment:4 Changed 4 months ago by cehoyos

  • Keywords nvdecode removed
  • Priority changed from important to wish
Note: See TracTickets for help on using tickets.