Encourage FUNIX

The consultation of the site is completely free and without advertisements. Donations are nevertheless appreciated to pay for hosting and encourage its author


Basic tools for video

Basic tools for video

Last modified February 20, 2025

This site has been automatically translated with Google Translate from this original page written in french, there may be some translation errors


Presentation

The tools presented on this page are necessary for the operation of most graphical interfaces dealing with video, whether they are tools for acquisition , editing , conversion and simply video playback .

Please note that I have decided to present the installation of these tools from sources in order to be able to adapt to all Linux distributions (and incidentally to have an optimized code and to be able to choose my compilation options if necessary). Most distributions already offer these tools in precompiled packages, you are free to use your favorite "package manager" (urpmi, apt-get, ...) to install them. This remark is valid for all other pages dealing with the video.

Installing Codecs and Audio Tools

Ogg vorbis

Presentation

Ogg Vorbis is a new audio compression format. It is comparable to other equivalent formats such as MP3, VQF or AAC except that it is completely free. It is generally considered to be more efficient than MP3. Ogg is actually the name of a container that can contain both audio and video, while vorbis is the compression algorithm used for audio included in an ogg container. Note that the ogg container can contain audio that uses a different compression method than vorbis (FLAC for example).
The official Ogg Vorbis website is http://www.vorbis.com/ where you can find the libogg and libvorbis  libraries as well as the libao audio library . This last library allows you to manage audio output across various software or hardware platforms (OSS, ESD, ALSA, AIX, Sun, Net/OpenBSD, IRIX, ...).

Facility

We unzip the first archive by typing

tar xvfz libao-1.2.0.tar.gz

This gives the libao-1.2.0 directory . We will ensure that the lib64x11-devel , lib64alsa2-devel and pulseaudio-devel packages are installed, we now type successively

./configure
make

Then as root

make install

In the /etc/ld.so.conf file we will add the following lines (if not already done)

/usr/local/lib
/usr/local/lib/ao/plugins-4

Then we type

ldconfig

Let's move on to libogg , we unzip the archive by typing

tar xvfz libogg-1.3.5.tar.gz

This gives the libogg-1.3.5 directory in which we type successively

./configure
make

Then as root

make install

Let's move on to libvorbis , we unzip the archive by typing

tar xvf libvorbis-1.3.7.tar.xz

This gives the libvorbis-1.3.7 directory in which we type successively

./configure
make

then as root

make install
ldconfig


Installing FLAC

FLAC (Free Lossless Audio Codec) is a compression algorithm that is similar to MP3 except that the compression is done without loss of quality. Its official website is https://xiph.org/flac/ where you will retrieve the archive that you decompress by typing:

tar xvf flac-1.5.0.tar.xz

This gives the flac-1.5.0 directory . In the flac directory type ./configure make then as root make install Check that the line /usr/local/lib is in the /etc/ld.so.conf file then type ldconfig



[ Back to top of page ]

LAME Installation

LAME which stands for Ain't an MP3 Encoder is located at the URL http://sourceforge.net/projects/lame/ . As its name indicates it is an MP3 encoder, it is used in particular by software to build avi (with an audio track in mp3).

We decompress the tarball by typing:

tar xvfz lame-3.100.tar.gz

This gives the lame-3.100 directory in which we type successively

./configure
make

Then as root

make install

Installing a52dec

The a52 library provides functions to decode A/52 stream. What is A/52 stream? This is the audio stream used by DVD, it is also known as AC-3, you will find more information in this document http://www.atsc.org/standards/a_52a.pdf . This library is necessary to be able to read DVDs or manage Dolby Digital streams.
The official URL is http://liba52.sourceforge.net/ where you can retrieve the archive and decompress it by typing

tar xvfz a52dec-0.7.4.tar.gz

This gives the directory a52dec-0.7.4 in which we type

./configure --with-pic --enable-shared --disable-static

The options --with-pic --enable-shared --disable-static are useful in 64bit mode for compiling ffmpeg and that's not enough, you have to edit all the Makefile files and instead of

CC = gcc

add

CC = gcc -fPIC

type make then as root

make install
ldconfig


Facade installation

Faad is an AAC (Advanced Audio Coding) compatible audio codec. AAC is an audio compression format comparable to MP3, which was developed as part of the MPEG2 and then MPEG4 standard, it is the successor to MP3 which was previously developed for MPEG2. Keen ears will notice that an AAC file encoded at 96kbps has a better sound quality than an mp3 file encoded at 128 kbps. The official URL is  https://github.com/knik0/faad2/releases where you will retrieve the archive that you decompress by typing

tar xvfz faad2-2.11.1.tar.gz


This gives the directory faad2-2.11.1 in which we type

 mkdir build
 cd build/
 cmake ..
 make

and finally as root

make install
ldconfig

Faac installation

The FAAC library provides MPEG-4 and MPEG-2 AAC encoders. The official site is  https://github.com/knik0/faac where you can get the archive and unzip it by typing

tar xvfz faac-1_30.tar.gz

this gives the directory faac-1_30 in which we type

./bootstrap
./configure

make

and finally as root

make install
ldconfig

FDK AAC installation

FDK AAC is a library that supports different profiles of the AAC audio codec, it is considered one of the best AAC encoders. The official website is https://github.com/mstorsjo/fdk-aac where we will get the latest version that we will decompress by typing

tar xvfz fdk-aac-2.0.3.tar.gz

this gives the directory fdk-aac-2.0.3 in which we type

./autogen.sh
./configure
make


then as root

make install


Installing vo-aacenc

This library integrates an implementation of the AAC (Advanced Audio Coding) audio codec. The official site is http://sourceforge.net/projects/opencore-amr/files/vo-aacenc/ where you can get the archive and unzip it by typing

tar xvfz vo-aacenc-0.1.3.tar.gz

This gives the directory vo-aacenc-0.1.3 in which we type

./configure
make

then as root

make install


Installing LV2 plugins

LV2 is the acronym for LADSPA version 2, it is a library for creating audio plugins. The official website is https://lv2plug.in/ where you can get the latest archive that you unzip by typing

tar xvf lv2-1.18.10.tar.xz

this gives the lv2-1.18.10 directory in which we type

meson setup build

then as root

cd build
meson install

Rubber band installation

The Rubber band library is required for some audio effects that we use, including the pitch compensation effect from kdenlive . The official website is https://breakfastquay.com/rubberband/ we will first install the lib64vamp-plugin-sdk-devel package and unzip the archive by typing:

tar xvfj rubberband-4.0.0.tar.bz2

this will give the rubberband-4.0.0 directory in which we will type:

meson build && ninja -C build

and as root

ninja -C build/ install

ldconfig


Installing video codecs

Installing xvid

xvid is an MPEG4 compatible codec like DivX except that it is completely free. The official site is www.xvid.org we get the latest stable archive that we unzip by typing

tar xvfz xvidcore-1.3.7.tar.gz

This gives the xvidcore directory . We will ensure that the nasm package is installed. At the xvidcore level /build/generic we type

./configure

Then

make

Then as root

make install

I got this error there

ln: cannot create symbolic link '/usr/local/lib/libxvidcore.so.4': File exists
Makefile:144: recipe for target 'install' failed

so I had to delete the existing links

unlink /usr/local/lib/libxvidcore.so.4
unlink /usr/local/lib/libxvidcore.so

and restart make install , then type ldconfig

[ Back to top of page ]


GPAC Installation

GPAC is an implementation of the MPEG-4 standard used by other higher-level tools, we will first install lib64xv-devel. The official site is https://gpac.wp.imt.fr/ we retrieve the archive there which we unzip by typing

tar xvfz gpac-2.4.0.tar.gz

this gives the directory gpac-2.4.0 in which we type

./configure --enable-pic

this gives

** System Configuration
Install prefix: /usr/local
Source path: /usr/local/linux/multimedia/gpac-2.4.0
C   compiler: gcc
C++ compiler: g++
make: make
CPU: x86_64
Big Endian: no

** GPAC 2.4 rev Core Configuration **
Static Modules: no
debug version: no
GProf enabled: no
Memory tracking enabled: no
Sanitizer enabled: no
Fixed-Point Version: no
IPV6 Support: yes
QuickJS Support: yes (with qjs-libc)

** Detected libraries **
zlib: system (pkgconfig)
OpenGL support: yes
OpenSSL support: system (pkgconfig)
nghttp2: system (pkgconfig)
OSS Audio: yes
ALSA Audio: yes
Jack Audio: yes
Pulse Audio: yes
DirectFB: no
X11: yes (path: /usr/X11R6)
X11 Shared Memory support: yes
X11 XVideo support: yes
SDL: yes
DVB for Linux: yes
FreeType: system (pkgconfig)
JPEG: system (pkgconfig)
OpenJPEG: system (pkgconfig)
PNG: system (pkgconfig)
MAD: system
FAAD: system (pkgconfig)
XVID: system
FFMPEG: system (pkgconfig) - VVC supported
LZMA: yes
Xiph OGG: system (pkgconfig)
Platinum UPnP: no
Xiph Vorbis: system (pkgconfig)
Xiph Theora: system (pkgconfig)
A52 (AC3): system
OpenSVCDecoder: no
OpenHEVCDecoder: no
Freenect: no

Creating config.mak
Check config.log for detection failures
Done - type 'make help' for make info, 'make' to build

then type

make

then make install

Installing libx264

libx264 is a library for encoding video streams in the  H.264/MPEG-4 AVC format . You can get the archive here http://www.videolan.org/developers/x264.html and decompress it by typing

tar xvfj x264-master.tar.bz2

this gives the directoryx264-masterin which we type

./configure --enable-pic --enable-shared

you will probably need to install yasm first . Note that the --enable-pic --enable-shared  options are useful for 64-bit configurations to compile ffmpeg .

we return to libx264 and we can now type the configure command with the options described above and here is the result

You can run 'make' or 'make fprofiled' now.

platform:       X86_64
byte order:     little-endian
system:         LINUX
cli:            yes
libx264:        internal
shared:         yes
static:         no
bashcompletion: yes
asm:            yes
interlaced:     yes
avs:            yes
lavf:           yes
ffms:           no
mp4:            gpac
gpl:            yes
thread:         posix
opencl:         yes
filters:        resize crop select_every
lto:            no
debug:          no
gprof:          no
strip:          no
PIC:            yes
bit depth:      all
chroma format:  all

You can run 'make' or 'make fprofiled' now.

Then

make

then as root

make install
ldconfig

Installing libx265

HEVC or High Efficiency Video Coding also called H.265 is the codec that is supposed to eventually replace H.264 . It is given to give the same quality but with a file twice as small, or if you prefer a higher quality with a file of the same size. The official site is x265.org . You have to register to download, I don't like it too much so I got the latest archive from https://bitbucket.org/multicoreware/x265_git/downloads/

We will retrieve the archive there and decompress it by typing:

tar xvfz x265_4.1.tar.gz

this gives the directory x265_4.1 in which we type

cd build
cmake ../source
make

then as root

make install
 

Installing mpeg2dec

mpeg2dec is an MPEG2 compatible video decoder, its official site is http://libmpeg2.sf.net in which we retrieve the archive that we decompress by typing

tar xvfz mpeg2dec-0.4.1.tar.gz

This gives the directory mpeg2dec-0.4.1 we then install the lib64xv-devel package then we successively type

./configure --with-pic

the with-pic option is necessary for compilation for 64-bit platforms, but it is not enough, you will have to edit all the Makefiles and instead of

CC = gcc

put

CC = gcc -fPIC

type make then as root

make install
ldconfig



Installation of libraries, APIs and multimedia tools

Installing OpenCV

OpenCV which means Open Source Computer Vision library is a library that provides 500 algorithms, documentation and various display codes, it is used in particular for tracking elements in a video. We will first install the packages lib64lapack-devel, lib64gtk+3.0-devel, python3-numpy-devel, lib64blas-static-devel, lib64gphoto-devel, lib64vtk-devel, lib64ogre-devel, lib64openjpeg-devel, tesseract-devel for character recognition. For NVIDIA GPU owners, we will install the nvidia-cuda-toolkit-devel and nvidia-cuda-toolkit-samples packages for parallel computing on nvidia GPUs, for intel GPUs, we will install  lib64va-devel .

The official site is https://opencv.org where you can retrieve the official archive, which you unarchive by typing

tar xvfj
opencv-4.11.0.tar.gz

this gives the opencv-4.11.0 directory we will also recover extensions that we will find here https://github.com/opencv/opencv_contrib , we uncompress them by typing

tar xvf z opencv_contrib-4.11.0.tar.gz

this gives the opencv_contrib-4.11.0 directory. We return to the opencv-4.11.0 directory
in this directory we type

mkdir build

cd build

cmake -DWITH_CUDA=OFF -DCMAKE_BUILD_TYPE=Release -DOPENCV_EXTRA_MODULES_PATH=/home/olivier/compilation/opencv_contrib-4.11.0/modules/ -DWITH_OPENGL=ON -DOPENCV_ENABLE_NONFREE=ON -DTesseract_INCLUDE_DIR=/usr/include/tesseract - DOPENCV_GENERATE_PKGCONFIG=YES -DWITH_QT=ON -DOpenGL_GL_PREFERENCE=LEGACY   ..

For an Nvidia GPU, we will temporarily disable the CUDA functions , part of the code is no longer maintained (see here https://docs.nvidia.com/cuda/video-decoder/index.html ) and it crashes when compiling. We can add the options -DWITH_VA=ON -DWITH_VA_INTEL=ON for an Intel GPU. For the path of the opencv contribs , it will of course have to be adapted to your configuration

This is the result

-- General configuration for OpenCV 4.11.0 =======================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/olivier/compilation/opencv_contrib-4.11.0/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2025-02-20T08:12:54Z
-- Host: Linux 6.6.76-desktop-1.mga10 x86_64
-- CMake: 3.31.5
-- CMake generator: Unix Makefiles
-- CMake build tool: /bin/gmake
-- Configuration: Release
-- Algorithm Hint: ALGO_HINT_ACCURATE
--
-- CPU/HW features:
-- Baseline: SSE SSE2 SSE3
-- requested: SSE3
-- Dispatched code generation: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
-- SSE4_1 (18 files): + SSSE3 SSE4_1
-- SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
-- AVX (9 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
-- FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX FP16
-- AVX2 (38 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX FP16 AVX2 FMA3
-- AVX512_SKX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX FP16 AVX2 FMA3 AVX_512F AVX512_COMMON AVX512_SKX
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /bin/c++ (ver 14.2.0)
-- C++ flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- Linker flags (Debug): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: dl m pthread rt
-- 3rdparty dependencies:
--
-- OpenCV modules:
-- To be built: alphamat aruco bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform java line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: cannops cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev fastcv julia matlab ovis python2 sfm viz
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: YES
--
-- GUI: QT6
-- QT: YES (ver 6.8.1 )
-- QT OpenGL support: YES (Qt6::OpenGL )
-- GTK+: YES (ver 3.24.43)
-- OpenGL support: YES (/usr/lib64/libGL.so /usr/lib64/libGLU.so)
-- VTK support: NO
--
-- Media I/O:
-- ZLib: /usr/lib64/libz.so (ver 1.3.1)
-- JPEG: /usr/lib64/libjpeg.so (ver 80)
-- WEBP: /usr/lib64/libwebp.so (ver decoder: 0x0209, encode: 0x0210, demux: 0x0107)
-- AVIF: /usr/lib64/libavif.so.16.1.1 (ver 1.1.1)
-- PNG: /usr/lib64/libpng.so (ver 1.6.46)
-- TIFF: /usr/lib64/libtiff.so (ver 42 / 4.7.0)
-- JPEG 2000: OpenJPEG (ver 2.5.3)
-- OpenEXR: OpenEXR::OpenEXR (ver 3.1.11)
-- GIF: NO
-- HDR: YES
-- SUNRASTER: YES --
PXM: YES
-- PFM: YES
--
-- Video I/O:
-- FFMPEG: YES
-- avcodec: YES (61.3.100)
-- avformat: YES (61.1.100)
-- avutil: YES (59.8.100)
-- swscale: YES (8.1.100)
-- avresample: NO
-- GStreamer: YES (1.24.11)
-- v4l/v4l2: YES (linux/videodev2.h)
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Intel IPP: 2021.12.0 [2021.12.0]
-- at: /home/olivier/compilation/opencv-4.11.0/build/3rdparty/ippicv/ippicv_lnx/icv
-- Intel IPP IW: sources (2021.12.0)
-- at: /home/olivier/compilation/opencv-4.11.0/build/3rdparty/ippicv/ippicv_lnx/iw
-- VA: YES
-- Lapack: YES (/lib64/libopenblas.so)
-- Eigen: YES (ver 3.4.0)
-- Custom HAL: NO
-- Protobuf: build (3.19.1)
-- Flatbuffers: builtin/3rdparty (23.5.9)
--
-- OpenCL: YES (INTELVA)
-- Include path: /home/olivier/compilation/opencv-4.11.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 3:
-- Interpreter: /bin/python3 (ver 3.12.8)
-- Libraries: /usr/lib64/libpython3.12.so (ver 3.12.8)
-- Limited API: NO
-- numpy: /usr/lib64/python3.12/site-packages/numpy/_core/include (ver 2.1.3)
-- install path: lib/python3.12/site-packages/cv2/python-3.12
--
-- Python (for build): /bin/python3
--
-- Java:                         
-- ant: /bin/ant (ver 1.10.14)
-- Java: NO
-- JNI: /usr/lib/jvm/java/include /usr/lib/jvm/java/include/linux /usr/lib/jvm/java/include
-- Java wrappers: YES (ANT)
-- Java tests: YES
--
-- Install to: /usr/local
-- -----------------------------------------------------------------
--
-- Configuring done (33.8s)
-- Generating done (0.8s)
-- Build files have been written to: /home/olivier/compilation/opencv-4.11.0/build

Then under the opencv-4.11.0/build directory we type

make

I stumble upon this error

hal_internal.cpp:(.text._Z14lapack_gemm32fPKfmS0_mfS0_mfPfmiiii+0x15f): undefined reference to 'cblas_sgemm'

to solve it I edit the file build/modules/core/CMakeFiles/opencv_core.dir/flags.make and at the line CXX_FLAGS I add -lcblas and at the same place I do the same for the file link.txt with a modified beginning like this

/bin/c++ -fPIC -lcblas (...)

I type make again and now I get this error

dynafu.cpp:(.text._ZN2cv6dynafu10DynaFuImplINS_3MatEEC2ERKNS_5kinfu6ParamsE[_ZN2cv6dynafu10DynaFuImplINS_3MatEEC5ERKNS_5kinfu6ParamsE]+0x39c): undefined reference to 'glGenRenderbuffersEXT'

we will do the same thing in the directory build/modules/rgbd/CMakeFiles/opencv_rgbd.dir but this time by adding -lGL -lGLX -lGLU

we type make again then as rootmake install

that's not all for the effects under kdenlive I had to create the following link

ln -s /usr/local/share/opencv4 /usr/share/opencv

So in theory opencv needs ffmpeg to compile, so I advise you to first install opencv without ffmpeg , compile ffmpeg , recompile opencv with ffmpeg and then start compiling frei0r again, it's tricky but it's the only way. You should not hesitate to delete the build directory to remove the cache.


Installation of frei0r

Now we will retrieve the frei0r library which provides a video API that is useful for video effects for video editing software, the official site is https://frei0r.dyne.org/ . We will first install the lib64gavl-devel package. We unzip the latest version by typing

tar xvfz frei0r-2.3.3.tar.gz

this gives the directory frei0r-2.3.3 in which we type successively

mkdir build
cd build
cmake ..

then we type

make

Then as root

make install

we will add the line to the /etc/ld.so.conf file

/usr/local/lib64/frei0r-1

and we type ldconfig

Attention I had to create the following link so that mlt can find the frei0r plugins

ln -s /usr/local/lib64/frei0r-1 /usr/local/lib/frei0r-1

Installing vid.stab

vid.stab is a plugin used to stabilize videos, it is used in particular for kdenlive , the official site is http://public.hronopik.de/vid.stab/ we will retrieve the archive there and decompress it by typing:

tar xvfz vid.stab-1.1.0.tar.gz

this gives the directory vid.stab-1.1.0 in which we type

cmake. -DCMAKE_BUILD_TYPE=Release make

then as root make install

Movit installation

movit is a video effects library that will use the resources of the graphics processors (GPU) generally present on the graphics card, in addition to the CPUs to accelerate applications thanks to parallel computing. We retrieve the sources on the official website https://movit.sesse.net/ that we unzip by typing

tar xvfz movit-1.7.1.tar.gz

this gives
movit-1.7.1 directory . For players we can retrieve the development version by typing

git clone http://git.sesse.net/movit


first of all you will need to install eigen which is a mathematical library for linear algebra. First we install the packages fftw3-devel, lib64epoxy-devel, lib64freeglut-devel and lib64sdl2.0-devel . The official site is here http://eigen.tuxfamily.org/index.php?title=Main_Page we get eigen 3.4.0 which we unzip by typing

tar xvfj eigen-3.4.0.tar.bz2

this gives the eigen-3.4.0 directory in which we type

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCUDA_SDK_ROOT_DIR=/usr/share/nvidia-cuda-toolkit/ -DCUDA_TOOLKIT_ROOT_DIR= /usr/share/nvidia-cuda-toolkit/ -DEIGEN_TEST_CUDA=on
make

note the options -DCUDA_SDK_ROOT_DIR=/usr/share/nvidia-cuda-toolkit/ -DCUDA_TOOLKIT_ROOT_DIR= /usr/share/nvidia-cuda-toolkit/ -DEIGEN_TEST_CUDA=on are for owners of nvidia GPUs, then as root

make install
cp eigen3.pc /usr/local/lib/pkgconfig

we will also install the google library to be able to test the C++ code, the official site is here https://code.google.com/p/googletest/ we unzip the archive by typing

tar xvfz googletest-1.15.2.tar.gz

this gives the directory googletest-1.15.2 in which we type

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make

then as root

make install

we return to the movit directory and type

./configure

we then edit the Makefile and modify the first line (by adapting the path) as follows

GTEST_DIR ?= /usr/local/linux/multimedia/googletest-1.15.2/googletest

then we type

make

then as root

make install


Installing ffmpeg

If you have a firewire input, you must first install the basic tools to control an ieee1394 compatible miniDV camcorder, it's here .

ffmpeg is an MPEG-4 compatible video codec its official website ishttp://ffmpeg.org/download.html. We uncompress the last archive by typing

tar xvf ffmpeg-7.1.tar.xz

this will give the directory ffmpeg-7. 1 in which we type

./configure --enable-shared --enable-gpl --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-nonfree --enable-frei0r --enable-libpulse --enable-version3 --enable-opengl --enable-opencl --disable-stripping --enable-libgsm --enable-libvpx --enable-chromaprint --enable-avfilter  --enable-librubberband --enable-libopencv --enable-libass --enable-pic --enable-libvidstab --enable-vdpau --enable-libnpp --enable-cuda-nvcc --nvcc=nvcc --enable-cuvid --enable-ffnvcodec

We will first install the packages lib64gsm-devel , lib64schroedinger-devel , lib64vpx-devel , lib64vdpau-devel , lib64sdl2.0-devel and lib64opencl-devel

Note the options --enable-libnpp --enable-cuda-nvcc --nvcc=nvcc --enable-cuvid --enable-ffnvcodec for owners of nvidia GPUs which may generate the following error

ERROR: cuda requested, but not all dependencies are satisfied: ffnvcodec

we will recover the missing dependency by typing

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

directory we type make then as root make install we retype configure with all its options. For the following error

ERROR: failed checking for nvcc.

In fact it is a compatibility problem between nvcc and gcc , first you will have to disable the functions around nvcc by retyping configure and removing the options --enable-cuda-nvcc --nvcc=nvcc

If OpenCV is not recognized correctly, you will have to type first

export CFLAGS=" -I/usr/local/include/opencv4" export LDFLAGS=-L/usr/local/lib64: $LDFLAGS

export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:$PKG_CONFIG_PATH

and modify the file /usr/local/include/opencv4/opencv2/core/cvdef.h like this

/******************************************************************************************\
* C++ 11 *
\****************************************************************************************/
#ifndef CV_CXX11
/*# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800)
# define CV_CXX11 1
# endif
#else
# if CV_CXX11 == 0
# undef CV_CXX11
# endif
#endif
#ifndef CV_CXX11
# error "OpenCV 4.x+ requires enabled C++11 support"*/
#endif

#define CV_CXX_MOVE_SEMANTICS 1
#define CV_CXX_MOVE(x) std::move(x)
#define CV_CXX_STD_ARRAY 1
//#include <array>
#ifndef CV_OVERRIDE
# define CV_OVERRIDE override
#endif
#ifndef CV_FINAL
# define CV_FINAL final
#endifmake -

we type  make

libavcodec/libx265.c: In function 'libx265_encode_frame':
libavcodec/libx265.c:813:59: error: passing argument 5 of 'ctx->api->encoder_encode' from incompatible pointer type [-Wincompatible-pointer-types]
  813 | pic ? &x265pic : NULL, x265pic_lyrptr_out);

We will apply this patch https://github.com/FFmpeg/FFmpeg/commit/1f801dfdb5066aadf0ade9cb5e94d620f33eacdc

we type make again then as root

make install
ldconfig

The list of formats supported by ffmpeg can be obtained by typing

ffmpeg -formats

To see if hardware accelerations are in place if you have an NVIDIA, you have the list of encoders by typing

ffmpeg -hide_banner -encoders | grep nvenc

here is the result

 V....D av1_nvenc NVIDIA NVENC av1 encoder (av1 codec)
 V....D h264_nvenc NVIDIA NVENC H.264 encoder (h264 codec)
 V....D hevc_nvenc NVIDIA NVENC hevc encoder (hevc codec)

And

ffmpeg -hide_banner -decoders | grep cuvid

will give

 V..... av1_cuvid Nvidia CUVID AV1 decoder (av1 codec)
 V..... h264_cuvid Nvidia CUVID H264 decoder (h264 codec)
 V..... hevc_cuvid Nvidia CUVID HEVC decoder (hevc codec)
 V..... mjpeg_cuvid Nvidia CUVID MJPEG decoder (mjpeg codec)
 V..... mpeg1_cuvid Nvidia CUVID MPEG1VIDEO decoder (mpeg1video codec)
 V..... mpeg2_cuvid Nvidia CUVID MPEG2VIDEO decoder (mpeg2video codec)
 V..... mpeg4_cuvid Nvidia CUVID MPEG4 decoder (mpeg4 codec)
 V..... vc1_cuvid Nvidia CUVID VC1 decoder (vc1 codec)
 V..... vp8_cuvid Nvidia CUVID VP8 decoder (vp8 codec)
 V..... vp9_cuvid Nvidia CUVID VP9 decoder (vp9 codec)

the list of hardware acceleration methods is obtained by typing

ffmpeg -hide_banner -hwaccels

here is the result

Hardware acceleration methods:
vdpau
cuda
vaapi
drm
opencl

[ Back to FUNIX home page ]