• Ganapathy Kasi's avatar
    avcodec/nvenc: fix hw accelerated transcode with bframes · 43c417ac
    Ganapathy Kasi authored
    hw accelerated transcode (h264_cuvid -> h264_nvenc with -hwaccel cuvid) was
    broken after the filtergraph initialization was changed to intialize decoder
    first followed by encoder (commit af1761f7).
    During initialzing encoder with bframes, local buffers are allocated
    internally in encoder which fails since no cuda context is available. Now
    pushing the correct cuda context before encoder initialization fixes the issue.
    Also adding push/pop cuda ctx during create/destroy/map/unmap resources and
    destroy encoder session.
    Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
    43c417ac
nvenc.c 65.3 KB