Opened 5 months ago

Last modified 5 months ago

#6495 new enhancement

Add low latency mode in nvcuvid/nvdecode

Reported by: abrevet Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: cuvid nvdecode
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 (2)

comment:1 follow-up: Changed 5 months ago by heleppkes

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

comment:2 in reply to: ↑ 1 Changed 5 months 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.

Note: See TracTickets for help on using tickets.