Closed catb0t closed 4 years ago
FFmpeg will automatically detect the ffnvcodec-headers
— extract from ./configure --help
:
The following libraries provide various hardware acceleration features:
--disable-amf disable AMF video encoding code [autodetect]
--disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
--enable-cuda-sdk enable CUDA features that require the CUDA SDK [no]
--disable-cuvid disable Nvidia CUVID support [autodetect]
--disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
--disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
--disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
--enable-libdrm enable DRM code (Linux) [no]
--enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
--enable-libnpp enable Nvidia Performance Primitives-based code [no]
--enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
--disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
--disable-nvenc disable Nvidia video encoding code [autodetect]
--enable-omx enable OpenMAX IL code [no]
--enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
--enable-rkmpp enable Rockchip Media Process Platform code [no]
--disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
--disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
--disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
--disable-videotoolbox disable VideoToolbox code [autodetect]
Before you sudo dpkg -i *.deb
– you should rm -f libavcodec-extra* libavfilter-extra*
I just installed nvidia-driver-435
and before pulled the new ffnvcodec
headers (and installed them), updated the manual and rebootet but did not build ffmpeg anew and its all working...
$ ffmpeg -decoders | grep cuvid
V..... h264_cuvid Nvidia CUVID H264 decoder (codec h264)
V..... hevc_cuvid Nvidia CUVID HEVC decoder (codec hevc)
V..... mjpeg_cuvid Nvidia CUVID MJPEG decoder (codec mjpeg)
V..... mpeg1_cuvid Nvidia CUVID MPEG1VIDEO decoder (codec mpeg1video)
V..... mpeg2_cuvid Nvidia CUVID MPEG2VIDEO decoder (codec mpeg2video)
V..... mpeg4_cuvid Nvidia CUVID MPEG4 decoder (codec mpeg4)
V..... vc1_cuvid Nvidia CUVID VC1 decoder (codec vc1)
V..... vp8_cuvid Nvidia CUVID VP8 decoder (codec vp8)
V..... vp9_cuvid Nvidia CUVID VP9 decoder (codec vp9)
$ ffmpeg -encoders | grep nvenc*
V..... h264_nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_h264 NVIDIA NVENC H.264 encoder (codec h264)
V..... nvenc_hevc NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)
$ obs
...
info: ---------------------------------
warning: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
libDeckLinkAPI.so: cannot open shared object file: No such file or directory
info: No blackmagic support
info: NVENC supported
info: FFMPEG VAAPI supported
info: VLC found, VLC video source enabled
info: ---------------------------------
info: Loaded Modules:
info: libobs-linuxbrowser.so
info: vlc-video.so
info: text-freetype2.so
info: rtmp-services.so
info: obs-x264.so
info: obs-transitions.so
info: obs-outputs.so
info: obs-libfdk.so
info: obs-filters.so
info: obs-ffmpeg.so
info: linux-v4l2.so
info: linux-pulseaudio.so
info: linux-jack.so
info: linux-decklink.so
info: linux-capture.so
info: linux-alsa.so
info: image-source.so
info: frontend-tools.so
info: decklink-ouput-ui.so
info: ---------------------------------
info: ==== Startup complete ===============================================
...
mpv ....mp4
Playing: ....mp4
(+) Video --vid=1 (*) (h264 1280x532 30.000fps)
(+) Audio --aid=1 (*) (aac 2ch 48000Hz)
Using hardware decoding (nvdec).
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1280x532 cuda[nv12]
AV: 00:00:04 / 02:37:00 (0%) A-V: 0.000
Exiting... (Quit)
You only need --enable-nonfree
in your rules
for --libfdk-aac
The error from libavcodec / libavfilter actually happens regardless of whether they were removed. So something else is going on but I don't know what
$ rm libavcodec-extra* libavfilter-extra*
removed 'libavcodec-extra_4.1.3-0ubuntu1_all.deb'
removed 'libavcodec-extra58_4.1.3-0ubuntu1_amd64.deb'
removed 'libavcodec-extra58-dbgsym_4.1.3-0ubuntu1_amd64.ddeb'
removed 'libavfilter-extra_4.1.3-0ubuntu1_all.deb'
removed 'libavfilter-extra7_4.1.3-0ubuntu1_amd64.deb'
removed 'libavfilter-extra7-dbgsym_4.1.3-0ubuntu1_amd64.ddeb'
$ sudo dpkg -i *.deb
(Reading database ... 490489 files and directories currently installed.)
Preparing to unpack ffmpeg_4.1.3-0ubuntu1_amd64.deb ...
Unpacking ffmpeg (7:4.1.3-0ubuntu1) over (7:4.1.3-0ubuntu1) ...
Preparing to unpack ffmpeg-doc_4.1.3-0ubuntu1_all.deb ...
Unpacking ffmpeg-doc (7:4.1.3-0ubuntu1) over (7:4.1.3-0ubuntu1) ...
dpkg: regarding libavcodec58_4.1.3-0ubuntu1_amd64.deb containing libavcodec58:amd64:
libavcodec-extra58:amd64 conflicts with libavcodec58
libavcodec58:amd64 (version 7:4.1.3-0ubuntu1) is to be installed.
dpkg: error processing archive libavcodec58_4.1.3-0ubuntu1_amd64.deb (--install):
conflicting packages - not installing libavcodec58:amd64
Preparing to unpack libavcodec-dev_4.1.3-0ubuntu1_amd64.deb ...
Unpacking libavcodec-dev:amd64 (7:4.1.3-0ubuntu1) over (7:4.1.3-0ubuntu1) ...
Preparing to unpack libavdevice58_4.1.3-0ubuntu1_amd64.deb ...
Unpacking libavdevice58:amd64 (7:4.1.3-0ubuntu1) over (7:4.1.3-0ubuntu1) ...
Preparing to unpack libavdevice-dev_4.1.3-0ubuntu1_amd64.deb ...
Unpacking libavdevice-dev:amd64 (7:4.1.3-0ubuntu1) over (7:4.1.3-0ubuntu1) ...
dpkg: regarding libavfilter7_4.1.3-0ubuntu1_amd64.deb containing libavfilter7:amd64:
libavfilter-extra7:amd64 conflicts with libavfilter7
libavfilter7:amd64 (version 7:4.1.3-0ubuntu1) is to be installed.
dpkg: error processing archive libavfilter7_4.1.3-0ubuntu1_amd64.deb (--install):
conflicting packages - not installing libavfilter7:amd64
[...]
Errors were encountered while processing:
libavcodec58_4.1.3-0ubuntu1_amd64.deb
libavfilter7_4.1.3-0ubuntu1_amd64.deb
Taking all of your suggestions, I still get no output from ffmpeg -decoders | grep cuvid
etc
can you post the output of apt-cache policy libavcodec-extra58
and libavfilter-extra7
$ apt-cache policy libavcodec-extra58
libavcodec-extra58:
Installed: (none)
Candidate: 7:4.1.3-0ubuntu1
Version table:
7:4.1.3-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu disco-updates/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu disco-security/universe amd64 Packages
7:4.1.1-1 500
500 http://archive.ubuntu.com/ubuntu disco/universe amd64 Packages
$ apt-cache policy libavfilter-extra7
libavfilter-extra7:
Installed: (none)
Candidate: 7:4.1.3-0ubuntu1
Version table:
7:4.1.3-0ubuntu1 500
500 http://archive.ubuntu.com/ubuntu disco-updates/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu disco-security/universe amd64 Packages
7:4.1.1-1 500
500 http://archive.ubuntu.com/ubuntu disco/universe amd64 Packages
It seems you have the extra packages installed, or idk. If you do, remove all the packages, and do a clean FFmpeg
install.
sudo apt-get remove ffmpeg ffmpeg-doc libavcodec-dev libavcodec58 libavfilter7 libavfilter-dev libavformat58 libavformat-dev libavresample4 libavresample-dev libavutil-dev libavutil56 libavdevice58 libavdevice-dev libswscale5 libswscale-dev libswresample3 libswresample-dev libpostproc55 libpostproc-dev libavfilter-extra7 libavcodec-extra58
Then pull
the newest ffnvcodec-headers
from git
and install them (make && sudo make install
), reboot and then build FFmpeg
and you can decide if you wanna use the extra
versions or the none extra
ones – just not both.
They were installed; thanks for your help. Btw, --enable-nonfree
is also for --enable-libnpp
, NIVIDIA's Performance Primitives, and I'm linking against the CUDA SDK.
I have used these instructions successfully before on Ubuntu 18.10, but this time I am getting a problem I can't work around.
Installing version 435 instead of 430, because that's where my system packages were already:
Using the following additions to
ffmpeg-4.1.3/debian/rules
:debuild
is successful and the "Programs:" section at the beginning contains the linesdpkg -i *.deb
only has the expected errors:Because of
rm libav{filter,codec}-extra*
.the resulting ffmpeg apparently has all the hardware accelerators:
But that is a lie:
OBS agrees that this ffmpeg doesn't have any hardware accelerated capabilities.
As another piece of evidence,
ffmpeg
's banner includes build flags such as--enable-nvenc
, etc, but also includes this line, which might be related to the problem?Some sources say that this message is due to mismatched versions of libraries upon which ffmpeg relies.
I haven't built any of those from source or checked their versions, but they're all only from the official repositories, not PPAs, I'm quite sure.
Do you have any pointers for me?