[FFmpeg-user] A question on H.264 High 4:4:4 Predictive decode support on NVIDIA Pascal hardware via nvdec
Dennis Mungai
dmngaie at gmail.com
Thu May 9 02:53:01 EEST 2019
On Thu, 9 May 2019 at 02:44, Dennis Mungai <dmngaie at gmail.com> wrote:
> Hello there,
>
> I have a sample file with the following attributes:
>
> ffprobe -i rv.mkv
> ffprobe version N-93814-g48539b62fc Copyright (c) 2007-2019 the FFmpeg
> developers
> built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04)
> configuration: --pkg-config-flags=--static --prefix=/home/brainiarc7/bin
> --bindir=/home/brainiarc7/bin --extra-cflags=-I/home/brainiarc7/bin/include
> --extra-ldflags=-L/home/brainiarc7/bin/lib --enable-cuda-nvcc
> --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include/
> --extra-ldflags=-L/usr/local/cuda/lib64/ --enable-nvenc
> --extra-cflags=-I/opt/intel/mediasdk/include
> --extra-ldflags=-L/opt/intel/mediasdk/lib
> --extra-ldflags=-L/opt/intel/mediasdk/plugins --enable-libmfx
> --enable-libass --enable-vaapi --disable-debug --enable-libvorbis
> --enable-libvpx --enable-libdrm --enable-opencl --enable-gpl --cpu=native
> --enable-opengl --enable-libfdk-aac --enable-libx265 --enable-openssl
> --extra-libs='-lpthread -lm -lz' --enable-nonfree
> libavutil 56. 26.101 / 56. 26.101
> libavcodec 58. 52.101 / 58. 52.101
> libavformat 58. 27.103 / 58. 27.103
> libavdevice 58. 7.100 / 58. 7.100
> libavfilter 7. 50.100 / 7. 50.100
> libswscale 5. 4.100 / 5. 4.100
> libswresample 3. 4.100 / 3. 4.100
> libpostproc 55. 4.100 / 55. 4.100
> Input #0, matroska,webm, from 'rv.mkv':
> Metadata:
> ENCODER : Lavf58.27.102
> Duration: 00:02:24.77, start: 0.000000, bitrate: 20063 kb/s
> Stream #0:0: Video: h264 (High 4:4:4 Predictive),
> yuv444p(progressive), 2560x1440, 60 fps, 60 tbr, 1k tbn, 120 tbc (default)
> Metadata:
> ENCODER : Lavc58.51.100 libx264
> DURATION : 00:02:24.767000000
>
>
> Attempting to use either cuvid,nvdec or auto (which selects cuda) for
> hwaccel results in the following message:
>
> [h264 @ 0x55ff3d516880] Hardware is lacking required capabilities
> [h264 @ 0x55ff3d516880] Failed setup for format cuda: hwaccel
> initialisation returned error.
>
> But the encode session runs to completion.
>
> Explicitly setting hwaccel to vdpau fails as such:
>
> [h264 @ 0x560d4b9f3340] hardware accelerator failed to decode picture
> Error while decoding stream #0:0: Input/output error
> [h264 @ 0x560d4b9f9280] hardware accelerator failed to decode picture
> Error while decoding stream #0:0: Input/output error
> [h264 @ 0x560d4bd5a8c0] hardware accelerator failed to decode picture
> Error while decoding stream #0:0: Input/output error
> [matroska,webm @ 0x560d4b9d2bc0] Element at 0x15a3f012 ending at
> 0x15a3f0a4 exceeds containing master element ending at 0x15a3f006
> [h264 @ 0x560d4bf22d00] hardware accelerator failed to decode picture
> Error while decoding stream #0:0: Input/output error
> Last message repeated 11 times
> Output #0, mp4, to
> '/home/brainiarc7/Desktop/src/benchmarks/final/benchmark-nvenc-file.mp4':
> Metadata:
> encoder : Lavf58.27.103
> Stream #0:0: Video: h264 (h264_nvenc) (High 4:4:4 Predictive) (avc1 /
> 0x31637661), yuv444p, 2560x1440, q=-1--1, 7500 kb/s, 60 fps, 15360 tbn, 60
> tbc (default)
> Metadata:
> DURATION : 00:02:24.767000000
> encoder : Lavc58.52.101 h264_nvenc
> Side data:
> cpb: bitrate max/min/avg: 15000000/0/7500000 buffer size: 15000000
> vbv_delay: -1
> frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.00 bitrate=N/A
> speed= 0x
> video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: unknown
> Conversion failed!
>
> In this case, with vdpau, the error is not recoverable and the encoder
> fails.
>
> The command used:
>
> ffmpeg -y -stats -hwaccel nvdec \
> -i $(pwd)/rv.mkv \
> -c:v h264_nvenc -bf:v 3 -rc:v vbr_hq -qp:v 19 -profile:v main \
> -b:v 7.5M -maxrate:v 15M -r:v 60 -an -f mp4
> $(pwd)/benchmark-nvenc-file.mp4
>
>
> FFmpeg version used:
>
> ffmpeg
> ffmpeg version N-93814-g48539b62fc Copyright (c) 2000-2019 the FFmpeg
> developers
> built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04)
> configuration: --pkg-config-flags=--static --prefix=/home/brainiarc7/bin
> --bindir=/home/brainiarc7/bin --extra-cflags=-I/home/brainiarc7/bin/include
> --extra-ldflags=-L/home/brainiarc7/bin/lib --enable-cuda-nvcc
> --enable-cuvid --enable-libnpp --extra-cflags=-I/usr/local/cuda/include/
> --extra-ldflags=-L/usr/local/cuda/lib64/ --enable-nvenc
> --extra-cflags=-I/opt/intel/mediasdk/include
> --extra-ldflags=-L/opt/intel/mediasdk/lib
> --extra-ldflags=-L/opt/intel/mediasdk/plugins --enable-libmfx
> --enable-libass --enable-vaapi --disable-debug --enable-libvorbis
> --enable-libvpx --enable-libdrm --enable-opencl --enable-gpl --cpu=native
> --enable-opengl --enable-libfdk-aac --enable-libx265 --enable-openssl
> --extra-libs='-lpthread -lm -lz' --enable-nonfree
> libavutil 56. 26.101 / 56. 26.101
> libavcodec 58. 52.101 / 58. 52.101
> libavformat 58. 27.103 / 58. 27.103
> libavdevice 58. 7.100 / 58. 7.100
> libavfilter 7. 50.100 / 7. 50.100
> libswscale 5. 4.100 / 5. 4.100
> libswresample 3. 4.100 / 3. 4.100
> libpostproc 55. 4.100 / 55. 4.100
> Hyper fast Audio and Video encoder
> usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options]
> outfile}...
>
> Use -h to get full help or, even better, run 'man ffmpeg'
>
> The GPU matrix published by NVIDIA only indicates support for HEVC @ 4:4:4
> : https://developer.nvidia.com/video-encode-decode-gpu-support-matrix.
> That page indicates support for H.264 4:4:4 in NVENC (as from GM107+) but
> information on decode capability on the same is absent.
>
> According to the commit:
> https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/83c7ac2e47efd96927127c1c385cdbb5fb53cb02
>
> Only two codecs can handle 4:4:4: HEVC and MJPEG.
> Would this imply that support for H.264 @ 4:4:4 is either unsupported (in
> hardware, as implied above) or omitted in FFmpeg? Please clarify.
>
> Thanks for your time,
>
> Dennis.
>
To clarify: This was ran on a GTX 1070.
According to vdpauinfo, H.264 4:4:4 Predictive profile is supported:
vdpauinfo
display: :0 screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library 430.09 Thu Apr 18
02:24:44 CDT 2019
Video surface:
name width height types
-------------------------------------------
420 8192 8192 NV12 YV12
422 8192 8192 UYVY YUYV
444 8192 8192
Decoder capabilities:
name level macbs width height
----------------------------------------------------
MPEG1 0 65536 4096 4096
MPEG2_SIMPLE 3 65536 4096 4096
MPEG2_MAIN 3 65536 4096 4096
H264_BASELINE 51 65536 4096 4096
H264_MAIN 51 65536 4096 4096
H264_HIGH 51 65536 4096 4096
VC1_SIMPLE 1 8190 2048 2048
VC1_MAIN 2 8190 2048 2048
VC1_ADVANCED 4 8190 2048 2048
MPEG4_PART2_SP 3 8192 2048 2048
MPEG4_PART2_ASP 5 8192 2048 2048
DIVX4_QMOBILE 0 8192 2048 2048
DIVX4_MOBILE 0 8192 2048 2048
DIVX4_HOME_THEATER 0 8192 2048 2048
DIVX4_HD_1080P 0 8192 2048 2048
DIVX5_QMOBILE 0 8192 2048 2048
DIVX5_MOBILE 0 8192 2048 2048
DIVX5_HOME_THEATER 0 8192 2048 2048
DIVX5_HD_1080P 0 8192 2048 2048
H264_CONSTRAINED_BASELINE 51 65536 4096 4096
H264_EXTENDED 51 65536 4096 4096
H264_PROGRESSIVE_HIGH 51 65536 4096 4096
H264_CONSTRAINED_HIGH 51 65536 4096 4096
H264_HIGH_444_PREDICTIVE 51 65536 4096 4096
HEVC_MAIN 153 262144 8192 8192
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---
Output surface:
name width height nat types
----------------------------------------------------
B8G8R8A8 32768 32768 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
R10G10B10A2 32768 32768 y Y8U8V8A8 V8U8Y8A8 A4I4 I4A4 A8I8 I8A8
Bitmap surface:
name width height
------------------------------
B8G8R8A8 32768 32768
R8G8B8A8 32768 32768
R10G10B10A2 32768 32768
B10G10R10A2 32768 32768
A8 32768 32768
Video mixer:
feature name sup
------------------------------------
DEINTERLACE_TEMPORAL y
DEINTERLACE_TEMPORAL_SPATIAL y
INVERSE_TELECINE y
NOISE_REDUCTION y
SHARPNESS y
LUMA_KEY y
HIGH QUALITY SCALING - L1 y
HIGH QUALITY SCALING - L2 -
HIGH QUALITY SCALING - L3 -
HIGH QUALITY SCALING - L4 -
HIGH QUALITY SCALING - L5 -
HIGH QUALITY SCALING - L6 -
HIGH QUALITY SCALING - L7 -
HIGH QUALITY SCALING - L8 -
HIGH QUALITY SCALING - L9 -
parameter name sup min max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH y 1 8192
VIDEO_SURFACE_HEIGHT y 1 8192
CHROMA_TYPE y
LAYERS y 0 4
attribute name sup min max
-----------------------------------------------------
BACKGROUND_COLOR y
CSC_MATRIX y
NOISE_REDUCTION_LEVEL y 0.00 1.00
SHARPNESS_LEVEL y -1.00 1.00
LUMA_KEY_MIN_LUMA y
LUMA_KEY_MAX_LUMA y
More information about the ffmpeg-user
mailing list