Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Question ffmpeg slot support and fixes 4 pkgs w <ffmpeg-5
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
awalp
n00b
n00b


Joined: 29 May 2003
Posts: 73

PostPosted: Wed Jul 12, 2023 5:23 pm    Post subject: Question ffmpeg slot support and fixes 4 pkgs w <ffmpeg-5 Reply with quote

Question about ffmpeg slot based support
......AND
Fixes for several packages with <ffmpeg-5 dependency problem.
-----------------------------------------------------

I've been dealing with ffmpeg4 API changes and compatibility issues with many packages while trying to upgrade to ffmpeg-5/ffmpeg-6.
(Which I need for zoneminder which as of now requires ffmpeg-5, in its latest build)

I think I'm gonna have to accept many packages will require <ffmpeg5 support due to age.

Is it possible to install ffmpeg via the slot system?
- So have both ffmpeg:4 and ffmpeg:5 or ffmpeg:6 installed simultaneously?

- I've read that's how some distributions have handled the issue, packages such as VLC won't built with vaapi from ffmpeg
(such as FreeBSD)


As far as VLC & <ffmpeg-5

Solution: I simply wrote a custom VLC 3.0.18-r4 w/ all #<ffmpeg-5 blocks removed, and built w/o vaapi.
-- vaapi specific library was removed in ffmpeg-5 and is what is causing packages to break, lib...... you can easily find the proper lib name.


As far as Handbrake & <ffmpeg-5

Solution: I simply wrote a handbrake 1.6.1 ebuild and the latest release built just fine with ffmpeg-5 on the system.

Transcode 1.1.7 & <ffmpeg-5 .ebuild took a bit more work, keeps trying to downgrade ffmpeg like many others but the fix was more challenging,
-- Following the instructions on Transcode's website it built just fine.

Solution:
I wrote a rough ebuild named it Transcode 1.1.7-r7
- simple removed the <ffmpeg-5 blocks
- only apply the single patch from their website
- have the src_configure build as their website says --disable--ffmpeg
For the sake of time to get it to build as an ebuild into the system, here is a very sloppy ebuild that includes the solution.
- I removed almost all the USE functions (sloppy, a Vanilla style approach)

Partial code from custom .ebuild
The goal of my .ebuild (which I haven't written one in years), was to build Vanilla style.

The only thing needed for it to build was one patch from their website.
Code:
transcode-1.1.7-gcc10_fix-1.patch

Which I downloaded and manually placed into the /var/db/repos/awalp/media-video/transcode/files/ directory.
and
building it with recommended configuration after patch.
Code:
                --enable-alsa
                --enable-libmpeg2
                --disable-ffmpeg

Code:

PATCHES=(
[b]   "${FILESDIR}"/${P}-gcc10_fix-1.patch[/b]
)

src_prepare() {
        default
        eautoreconf
}

rc_configure() {
        local myeconfargs=(
............
                --enable-alsa
                --enable-libmpeg2
                --disable-ffmpeg
...........
                ${myconf}
        )
   econf "${myeconfargs[@]}"
}


in the configure.

I removed all ffmpeg related stuff,
I realize I also probably removed most the USE flags functionality,
though I thought I'd post it to help get the ebuild fixed, someone/maintainer could integrate the solution better.
for the sake of time I just needed to get it built.


---------------------------------------------

Full ebuild for Transcode-1.1.7 (very sloppy USE functionality mostly not working)......
---------------------------------------------
Code:

  GNU nano 7.2                                                                                                            transcode-1.1.7-r7.ebuild                                                                                                                     
# Copyright 2002-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# awalp's custom sloppy .ebuild just to build transcode w/o ffmpeg support to fix problems with <ffmpeg-5 issue.

EAPI=8

inherit autotools

DESCRIPTION="Utilities for transcoding video and audio codecs in different containers"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
SRC_URI="https://www.bitbucket.org/france/${PN}-tcforge/downloads/${P}.tar.bz2"
#       https://dev.gentoo.org/~mgorny/dist/${P}-patchset.tar.bz2
#       https://dev.gentoo.org/~whissi/dist/${PN}/${PN}-1.1.7-ffmpeg4.patch.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm64 ppc ppc64 ~riscv sparc x86"
IUSE="cpu_flags_ppc_altivec cpu_flags_x86_3dnow a52 aac alsa dv dvd +iconv -imagemagick jpeg lzo mjpeg cpu_flags_x86_mmx mp3 mpeg nuv ogg oss pic postproc quicktime sdl cpu_flags_x86_sse cpu_flags_x86_sse2 theora truetype v4l vorbis X x264 xml xvid"

REQUIRED_USE="
        cpu_flags_x86_sse? ( cpu_flags_x86_mmx )
        cpu_flags_x86_sse2? ( cpu_flags_x86_mmx cpu_flags_x86_sse )
        cpu_flags_x86_3dnow? ( cpu_flags_x86_mmx )
        nuv? ( lzo )
"

# <ffmpeg-5 dep for bug #831482
RDEPEND="
   a52? ( media-libs/a52dec )
        aac? ( media-libs/faac )
        alsa? ( media-libs/alsa-lib )
        iconv? ( virtual/libiconv )
        jpeg? ( media-libs/libjpeg-turbo:= )
        lzo? ( >=dev-libs/lzo-2 )
        mjpeg? ( media-video/mjpegtools:= )
        mp3? ( media-sound/lame )
        mpeg? ( media-libs/libmpeg2 )
        ogg? ( media-libs/libogg )
        sdl? ( >=media-libs/libsdl-1.2.5[X?] )
        truetype? ( >=media-libs/freetype-2 )
        X? (
               x11-libs/libXaw
                x11-libs/libXpm
                x11-libs/libXv
        )
   x264? ( media-libs/x264:= )
        xml? ( dev-libs/libxml2 )
        xvid? ( media-libs/xvid )
"
DEPEND="${RDEPEND}"
BDEPEND="
   virtual/pkgconfig
        v4l? ( >=sys-kernel/linux-headers-2.6.11 )
"

PATCHES=(
   "${FILESDIR}"/${P}-gcc10_fix-1.patch
)

src_prepare() {
        default
        eautoreconf
}

rc_configure() {
        local myconf
        use x86 && myconf="$(use_enable !pic x86-textrels)" # bug 271476

        local myeconfargs=(
                $(use_enable mpeg libmpeg2)
                $(use_enable mpeg libmpeg2convert)
                --enable-experimental
                --enable-deprecated
                $(use_enable alsa)
                $(use_enable truetype freetype2)
                $(use_enable mp3 lame)
                $(use_enable xvid)
                --enable-alsa
                --enable-libmpeg2
                --disable-ffmpeg
                --with-mod-path=/usr/$(get_libdir)/transcode
                ${myconf}
        )
   econf "${myeconfargs[@]}"
}

src_install() {
        emake DESTDIR="${D}" docsdir=/usr/share/doc/${PF} install
        dodoc AUTHORS ChangeLog README STYLE TODO
        find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
}



---------------------------------------------

---------------------------------------------


Again, this will take a lot of work and may not be possible with older packages.

Can ffmpeg be installed w/ a slot based approach?
ffmpeg:4 simultaneously as ffmpeg:5 or ffmpeg:6
FreeBSD among other distros uses an ffmpeg-4 w/ ffmpeg-6 as their "dirty" solution.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1685

PostPosted: Wed Jul 12, 2023 5:53 pm    Post subject: Reply with quote

awalp wrote:
Again, this will take a lot of work and may not be possible with older packages.

Can ffmpeg be installed w/ a slot based approach?
ffmpeg:4 simultaneously as ffmpeg:5 or ffmpeg:6
FreeBSD among other distros uses an ffmpeg-4 w/ ffmpeg-6 as their "dirty" solution.

It is often even more work in order to make slots on libraries because of:
  1. Each slot must not install to the same file locations as another slot in addition to other packages
  2. The build systems of dependent packages must know how to access the different locations
Because of #2, this often makes it lots of work for many, many package maintainers to get it working in the first place when it is not natural to do so in the library upstream
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1685

PostPosted: Thu Jul 13, 2023 5:12 am    Post subject: Re: Question ffmpeg slot support and fixes 4 pkgs w Reply with quote

awalp wrote:

As far as VLC & <ffmpeg-5[/u]
Solution: I simply wrote a custom VLC 3.0.18-r4 w/ all #<ffmpeg-5 blocks removed, and built w/o vaapi.
-- vaapi specific library was removed in ffmpeg-5 and is what is causing packages to break, lib...... you can easily find the proper lib name.


Why do you need to do this? Just set USE=-vaapi, or use 9999 (which has it fixed, it's just too hard to backport to 3.x).
Back to top
View user's profile Send private message
bandreabis
Advocate
Advocate


Joined: 18 Feb 2005
Posts: 2490
Location: イタリアのロディで

PostPosted: Tue Jan 02, 2024 11:26 pm    Post subject: Reply with quote

When vaapi is needed and when isn't?
Many thanks.

Alias, when can I live well without if watching film or videos.

EDIT: without vaapi I could update everything, WOW. Maybe it's worth it
_________________
Il numero di post non fa di me un esperto! Anzi!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum