The verified way is using FFMPEG or LIBAV from command line (ffmpeg or avconv) or over library API (or direct API NVIDIA video codec SDK). Please check documentation https://developer.nvidia.com/designworks/dl/Using_FFmpeg_with_NVIDIA_GPU_Hardware_Acceleration-pdf, examples https://developer.nvidia.com/ffmpeg, blogs … “Plex Media Server” should use FFMPEG with this features.
Yes, same issue with latest Windows ffmpeg from March 11, 2020 (ffmpeg-20200311-36aaee2-win64-static), under Windows 7 x64, GeForce Game Ready Driver 442.59 from March 10, 2020, GIGABYTE GeForce RTX 2080 SUPER WINDFORCE OC 8G, model # GV-N208SWF3OC-8GD.
I see that “b_ref_mode each” is not supported by the GPU, and that “b_ref_mode middle” produces tons of warnings in the output about invalid DTS and PTS.
My command line is:
ffmpeg -v verbose -threads auto -probesize 9000000000 -analyzeduration 9000000000 -hwaccel cuda -hwaccel_output_format cuda -f concat -safe 0 -i ffmpeginputs.txt -filter_complex “concat=n=1:v=1:a=1 [vout] [aout]” -map “[vout]” -map “[aout]” -vcodec hevc_nvenc -bf 4 -temporal_aq 1 -rc-lookahead 20 -g 250 -vsync 0 -b_ref_mode 2 -dpb_size 3 “%FOLDERNAME%.mp4”
Not sure if the “-hwaccel_output_format cuda” is needed, but same DTS/PTS errors whether I have that or not. I haven’t found a combination of -bf and -dpb_size that works. Anyone have any suggestions? I do see that it’s an open bug at https://trac.ffmpeg.org/ticket/7303
The SDK include nvEncodeAPI.h in v9.2 seems to indicate that B-frame each is only not supported on H264. Now I guess it’ll depend on the card as well, but it’s not quite true to say Turing supports B-Frames if you can’t use it all. It’s like half an implementation. Is that something they can enhance?
- B-frame used as reference modes
typedef enum _NV_ENC_BFRAME_REF_MODE
NV_ENC_BFRAME_REF_MODE_DISABLED = 0x0, /< B frame is not used for reference */
NV_ENC_BFRAME_REF_MODE_EACH = 0x1, /< Each B-frame will be used for reference. currently not supported for H.264 */
NV_ENC_BFRAME_REF_MODE_MIDDLE = 0x2, /**< Only(Number of B-frame)/2 th B-frame will be used for reference */
Invalid DTS issue with b_ref_mode middle was fixed in https://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=aaadf0dce8fa7b3b5073089498a84e758ceb975a
Everybody please go here and spam )))) You will say thank you to ffmpeg devs (me and others) by that. https://github.com/obsproject/obs-studio/issues/2374
So using latest Zeranoe Windows ffmpeg build I see the following:
b_ref_mode each not supported for HEVC
I see that “b_ref_mode each” is not supported by the GPU
#8809 (hevc_nvenc / b_ref_mode each is not working) – FFmpeg
Can a Nvidia dev clarify whether HEVC is undeed supported “each” (it looks like it with ragaya nice code https://github.com/rigaya/NVEnc/blob/master/GPUFeatures/rtx2070.txt and my 2080 Ti). Also we need to know whether ffmpeg even has all done for “each”. Well, at least middle is fixed.
#8809 is IMHO fixed in https://trac.ffmpeg.org/ticket/8809#comment:3
P.S. tested it, it is fixed.