OBS Studio on Mageia 7 with nvenc

obtain ffmpeg nv codec headers:

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers

edit Makefile to use /usr as PREFIX and lib64 as LIBDIR instead /usr/local and lib, after build and install with:

make
sudo make install

now install dependencies:

urpmi libgsm-devel \
libcdio-paranoia-devel \
libmp3lame-devel \
libnut-devel \
libv4l-devel \
libpulseaudio-devel \
libsndio-devel \
texi2html \
yasm \
libopencl-devel \
libaom-devel \
libcelt0-devel \
libdav1d-devel \
libdirac-devel \
frei0r-devel \
libjack-devel \
libass-devel \
libdc1394-devel \
libjpeg-devel \
libmodplug-devel \
libopenjpeg2-devel \
opencv-devel \
libschroedinger-devel \
libsdl2.0-devel \
libspeex-devel \
libtwolame-devel \
libxavs-devel\
libfdk-aac-devel

after get package from http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/7/SRPMS/core/release|updates and edit spec file to add –enable-nvenc after remove sdl in BuildRequires and rebuild

rpmbuild -ba --define 'distro_section tainted' --with plf --with fdkaac ffmpeg.spec

remove tained packages already installed with:

rpm -e --nodeps ffmpeg-4.1.4 \
lib64avcodec58-4.1.4 \
lib64avfilter7-4.1.4 \
lib64avformat58-4.1.4 \
lib64avresample4-4.1.4 \
lib64avutil56-4.1.4 \
lib64ffmpeg-devel-4.1.4 \
lib64postproc55-4.1.4 \
lib64swresample3-4.1.4 \
lib64swscaler5-4.1.4

after install packages without static-devel, debugsource and debuginfo packages

 

 

 

in Mageia 6 instead you need only to:

# ln -s /usr/lib64/nvidia-current/bin/nvidia-modprobe /usr/bin/nvidia-modprobe
# ln -s /usr/lib64/nvidia-current/bin/nvidia-smi /usr/bin/nvidia-smi