Opened 5 years ago

Last modified 2 years 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

Description

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 by Hendrik, 5 years ago

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

in reply to:  1 comment:2 by abrevet, 5 years ago

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 by Carl Eugen Hoyos, 2 years ago

Keywords: nvdecode removed
Priority: importantwish
Note: See TracTickets for help on using tickets.