Opened 6 months ago

Closed 6 months ago

#6409 closed defect (invalid)

"h264_cuvid" and "h264_nvenc" can't share GPU memory

Reported by: ahakon Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: h264_cuvid, h264_nvenc, hw, cuda
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When transcoding using CUDA hardware, you can't use intermediate GPU memory. Then you need to copy to regular RAM using the hwdownload filter.

This doesn't work:

% ffmpeg -hwaccel cuvid -c:v h264_cuvid -deint 2 -resize 1280x720 -i <inputfile>  \
-c:v h264_nvenc -preset:v:0 medium -b:v:0 2500k \
-c:a copy <outputfile>

This works:

% ffmpeg -hwaccel cuvid -c:v h264_cuvid -deint 2 -resize 1280x720 -i <inputfile>  \
-filter:v scale_npp=w=720:h=576:format=nv12:interp_algo=2,hwdownload,format=nv12 \
-c:v h264_nvenc -preset:v:0 medium -b:v:0 2500k \
-c:a copy <outputfile>

Please, fix this! It's a must have that the chain decoder/filters/encoder uses only GPU frames without innecessary download/uploads to RAM.

Change History (2)

comment:1 Changed 6 months ago by oromit

Your exact commandline works perfectly fine for me.
Please provide the full uncut output you get, and test with latest ffmpeg master and latest nvidia drivers.

comment:2 Changed 6 months ago by ahakon

  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.