Solved ffmpeg install new version built with poudriere, remove old version and dependencies first

i just built ffmpeg with poudriere

to enable the SRT option to use with obs studio
for low latency streaming


the poudriere repos has a higher precedence than the freebsd repo
as per the handbook

im running 14.2 quarterly
and the poudriere jail is running 14.2 ports HEAD
is that an issue

however ffmpeg is already installed
and i cant figure out how to upgrade to the new version of ffmpeg built with poudriere

Code:
pkg update -f
pkg upgrade

Code:
pkg info ffmpeg

Code:
Version        : 6.1.2_4,1

Code:
pkg search ffmpeg

Code:
ffmpeg-6.1.2_4,1               Realtime audio/video encoder/converter and streaming server
ffmpeg-6.1.2_6,1               Realtime audio/video encoder/converter and streaming server

i have ffmpeg 6.1.2_4,1 from the freebsd repos installed
and want to install ffmpeg-6.1.2_6,1 built with poudriere

running pkg remove ffmpeg

Code:
pkg remove ffmpeg

will also remove all these packages

Code:
Installed packages to be REMOVED:
        ImageMagick7: 7.1.1.26_5
        ardour: 8.6.0_2
        aubio: 0.4.9_5
        ffmpeg: 6.1.2_4,1
        firefox: 133.0.3,2
        gstreamer1-libav: 1.24.8
        handbrake: 1.7.2_1
        kodi: 21.0_4
        kodi-addon-inputstream.adaptive: 21.5.4
        libheif: 1.18.2_1
        mpv: 0.39.0,1
        mpv-mpris: 1.1
        musicpd: 0.23.16
        obs-studio: 30.2.3
        vlc: 3.0.21_7,4
        waypipe: 0.9.2
        wlrobs: 1.1_3
        yt-dlp: 2024.09.27

Number of packages to be removed: 18

do you have to remove the currently installed version of ffmpeg
and all the above packages

then install ffmpeg built with poudriere
and reinstall all the packages you removed

i was going to set up a new boot environment, and boot into it
then at the tty before i log into the desktop

remove ffmpeg and the installed packages above
then install the new version of ffmpeg and reinstall the packages

or is there a better way that im missing

ffmpeg poudriere set up

 
ffmpeg built with poudriere installed

1 - create a boot env

Code:
sudo beadm create 14.2-ffmpeg

2 - activate the new boot env

Code:
sudo beadm activate 14.2-ffmpeg

3 - create a snapshot

Code:
sudo zfs snapshot -r zroot@15-12-2024-ffmpeg

4 - export a prime-list of packages

Code:
pkg prime-list > pkg-prime-list.txt
pkg info > pkg-list.txt

5- create a script to reinstall the packages that will be uninstalled
when you remove the old version of ffmpeg, and install the new version of ffmpeg

package-list.sh

Code:
#!/bin/sh

pkg install ffmpeg-6.1.2_6,1 ImageMagick7 ardour aubio firefox gstreamer1-libav handbrake kodi kodi-addon-inputstream.adaptive \
libheif mpv mpv-mpris musicpd obs-studio vlc waypipe wlrobs yt-dlp

6 - boot into the new boot env

boot into the new beadm boot env and log in at the tty
but dont log into the desktop

7 - uninstall the old ffmpeg

Code:
sudo pkg remove ffmpeg

which will remove all these packages on my system

Code:
Installed packages to be REMOVED:
        ImageMagick7: 7.1.1.26_5
        ardour: 8.6.0_2
        aubio: 0.4.9_5
        ffmpeg: 6.1.2_4,1
        firefox: 133.0.3,2
        gstreamer1-libav: 1.24.8
        handbrake: 1.7.2_1
        kodi: 21.0_4
        kodi-addon-inputstream.adaptive: 21.5.4
        libheif: 1.18.2_1
        mpv: 0.39.0,1
        mpv-mpris: 1.1
        musicpd: 0.23.16
        obs-studio: 30.2.3
        vlc: 3.0.21_7,4
        waypipe: 0.9.2
        wlrobs: 1.1_3
        yt-dlp: 2024.09.27

Number of packages to be removed: 18

8 - install the new version of ffmpeg and reinstall the removed packages
using the script we made in an earlier step

Code:
sudo ./package-list.sh

9 - reboot

Code:
sudo shutdown -r now

10 - ffmpeg from poudriere is now installed

built with

Code:
FDK_AAC JACK NONFREE SDL SRT

SDL will install ffplay
and i have to see if i can get SRT working with OBS Studio

ffmpeg scripts

scopes

ffplay using my scopes script to display a histogram
and vectorscope over a video of duke nuke em

come get some

20241215_14h02m31s_grim.png


20241215_14h03m24s_grim.png
 
so you could just run pkg clean all

Code:
sudo pkg clean -a

and then install ffmpeg

Code:
sudo pkg install -f ffmpeg


instead of doing it the way i did
and removing the packages that depend on ffmpeg and then reinstalling them

have i got that right
 
Yes, that will force it to fetch the 'new' version (with the changed options) and install it. Reinstalling the other packages that depend on ffmpeg is probably not necessary, but you could force install those too, without having to remove them first.
 
It helps when you've been using the tools for as long as the tools themselves existed :)

This should force the install of everything that depends on ffmpeg, pkg install -f $(pkg query '%rn' ffmpeg) # <- Bourne shell syntax!

pkg-query(8) is extremely useful.
 
bet DeepSeek wouldnt have come up with that

so in short

1 - clean the package cache

Code:
sudo pkg clean -a

2 - force install of new version of ffmpeg

Code:
sudo pkg install -f ffmpeg

3 - force the install of everything that depends on ffmpeg

Code:
sudo pkg install -f $(pkg query '%rn' ffmpeg)

removed the ` from the above

is the ` after ffmpeg correct ?

ffmpeg`
 
is the ` after ffmpeg correct ?
No, I made a couple of typos, have corrected them by editing the post.

But, like I said, you probably don't have to reinstall those other packages. From their point of view nothing changes if the options of ffmpeg changed. Can't hurt, and I usually do it just to be certain.
 
looks like we might have to hold off on training an LLM on SirDice
until we iron out a few errors in the training data

:)

just kidding great stuff
ill update my notes on github
 
I've got another neat trick for you. Compare pkg query '%Ok : %Ov' ffmpeg and pkg rquery '%Ok : %Ov' ffmpeg. That will tell you what options were set on the installed package (pkg-query(8)) and the remote package (pkg-rquery(8)). The cached catalog has to be up to date (pkg-update(8)) but that usually happens automatically anyway.
 
what about using query and rquery with diff

Code:
diff <(pkg query '%Ok : %Ov' ffmpeg) <(pkg rquery '%Ok : %Ov' ffmpeg) > diff.txt

not sure if i have that right

another version

Code:
diff -y <(pkg query '%Ok : %Ov' ffmpeg) <(pkg rquery '%Ok : %Ov' ffmpeg) > diff.txt
 
just a thought

what about a script that takes one argument which is a package name

and then uses query, rquery and diff to show you the difference between the two
so you can see what options are set in the local package vs the remote

i dont think the bourne shell supports redirection

so using the above syntax doesnt work in a bourne shell script
but the above command does work with the zsh shell
 
Back
Top