How to have two different versions of ffmpeg (4 and 6) on the same FreeBSD 14.0-RELEASE system.

Hello to everyone.

Can someone give a look at the lastest two posts of this bug report ?

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261302

specially where he says :

I found how to build it in system with ffmpeg4 installed and without ffmpeg-6 installed. So build work in poudriere with minimal changes in Makefile.

But for build on live system with both ffmpegs installed I found only one way - make symlinks on all ffmpeg4 libs with digit "4" and end:
libavutil4.so -> libavutil.so
libavutil4.so.56 -> libavutil.so.56
libavutil4.so.56.70.100 -> libavutil.so.56.70.100
And use something like this in Makefile:
CONFIGURE_ARGS+= LIBAVCODEC_LIBS="-L${LOCALBASE}/ffmpeg4/lib -lavcodec4"

Can someone explain (I don't ask a fully explanation,because otherwise there is no more pleasure to reach the goal) how to install ffmpeg 4 on FreeBSD 14.0-RELEASE without removing ffmpeg 6 ? I find useful /not only for me/ to do it because it seems that version 4 is not bugged,but version 6 can't be removed,otherwise a lot of different libraries and packages will be removed,too.
 
multimedia/ffmpeg4 really doesn't conflict with multimedia/ffmpeg.

Code:
Alexander88207@Home:~ $ doas pkg install ffmpeg4
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
    ffmpeg4: 4.4.4_9

Number of packages to be installed: 1

The process will require 33 MiB more space.
10 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching ffmpeg4-4.4.4_9.pkg: 100%   10 MiB  10.6MB/s    00:01  
Checking integrity... done (0 conflicting)
[1/1] Installing ffmpeg4-4.4.4_9...
[1/1] Extracting ffmpeg4-4.4.4_9: 100%
Alexander88207@Home:~ $ pkg info ffmpeg
ffmpeg-6.1.1,1
Name           : ffmpeg
Version        : 6.1.1,1
.....
 
Its not enough. I have installed ffmpeg4,but I can't use it. Only version 6 is usable. The little tutorial explained on the bug report does not match.
 
Yeah right, you also need to rebuild the application that you want to use with ffmpeg4.

However the best is that you try to resolve your problem with ffmpeg6 instead of sitting with an old ffmpeg, at an certain point you will be not able to use it anyway anymore.
 
This has been my solution. I should copy to the directory /usr/local/lib the following ones (some ffmpeg4 libs):

libavutil.so
libavutil.so.56
libavutil.so.56.70.100

So,what I did has been to rename one lib,related to ffmpeg6,like this :

Code:
cd /usr/local/lib
mv libavutil.so.58.29.100 _libavutil.so.58.29.100

and then I copied one ffmpeg4 lib from /usr/local/ffmpeg4/lib to /usr/local/lib :

Code:
cp /usr/local/ffmpeg4/lib/libavutil.so.56.70.100 /usr/local/libavutil.so.58.29.100

and finally :

Code:
cd /usr/local/bin
mv ffmpeg _ffmpeg
mv ffprobe _ffprobe
cd /usr/local/ffmpeg4/bin/
cp ffmpeg /usr/local/bin
cp ffprobe /usr/local/bin

et voila' :

Code:
marietto@marietto:/usr/local/bin # ffmpeg -version

ffmpeg version 4.4.4 Copyright (c) 2000-2023 the FFmpeg developers
built with FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
configuration: --prefix=/usr/local/ffmpeg4 --mandir=/usr/local/ffmpeg4/man --datadir=/usr/local/ffmpeg4/share/ffmpeg4 --docdir=/usr/local/ffmpeg4/share/doc/ffmpeg4 --pkgconfigdir=/usr/local/ffmpeg4/libdata/pkgconfig --disable-static --disable-libcelt --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --cxx=c++ --enable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libklvanc --disable-libkvazaar --disable-ladspa --enable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --enable-network --disable-nonfree --enable-nvenc --disable-openal --disable-opencl --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --disable-libopenvino --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --disable-librist --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --enable-libsvtav1 --disable-libtensorflow --disable-libtesseract --disable-libtheora --disable-libtwolame --disable-libuavs3d --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --enable-libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-vulkan --enable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --disable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi
libavutil      56. 70.100 / 56. 70.100
libavcodec     58.134.100 / 58.134.100
libavformat    58. 76.100 / 58. 76.100
libavdevice    58. 13.100 / 58. 13.100
libavfilter     7.110.100 /  7.110.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  9.100 /  5.  9.100
libswresample   3.  9.100 /  3.  9.100
libpostproc    55.  9.100 / 55.  9.100

sorry,my solution has been more tricky than the one proposed,but I didn't know how to apply that. My ignorance.
 
Yeah right, you also need to rebuild the application that you want to use with ffmpeg4.

However the best is that you try to resolve your problem with ffmpeg6 instead of sitting with an old ffmpeg, at an certain point you will be not able to use it anyway anymore.

I think that it's not my problem,there is a bug somewhere that's not sure if it has been fixed.
 
What do you mean with "you also need to rebuild the application that you want to use with ffmpeg4" ? Let's say that I want to use smplayer with mmpeg4. I have removed that package and I've reinstalled it,but it does not work. So,I presume that I should remove the package and I should reinstall it from the ports ?
 
I recommend that you don't go down another one of your dead ends.

If you really want to then I recommend that you create a new subtree with old installations. Pseudocode like this:
Code:
mkdir -p /opt/oldcrap
cd ffmpeg-4-src # or the work subdir of the port after `make patch`
./configure --prefix=/opt/oldcrap
make install
PATH=/opt/oldcrap/bin:$PATH
# same for $LD_LIBRARY_PATH
 
What dead ends ? the thread about the installation of FreeBSD on the Chromebook has been removed before I was able to accomplish the goal. It's not a dead end. I've just installed FreeBSD 12.04 there. Since ports still working on 12.04,I consider this a partial success. Later I will try to tinker with the system files to be able to compile the kernel with FreeBSD 13.2. I'm hard to die.

And I've just recompiled smplayer from the ports and I see that finally vdpau is recognized and it works with ffmpeg4.
 
Back
Top