[FFmpeg-devel] [RFC] libavutil split out
Zhao Zhili
quinkblack at foxmail.com
Thu Oct 31 05:11:33 EET 2024
> On Oct 31, 2024, at 08:13, Timo Rothenpieler <timo at rothenpieler.org> wrote:
>
> On 31.10.2024 01:08, Michael Niedermayer wrote:
>> Hi
>> Theres a problem with libavutil, or maybe more than one
>> a library implementing a codec that tries do use libavutil and itself is
>> used by libavcodec. Creates a (build) dependancy like this
>> libavutil -> libmycodec -> libavcodec
>> Thats ok if libavutil is a seperate source but if libavutil and libavcodec
>> are in the same source package and are build together, well iam sure
>> you see this doesnt work
>> build ffmpeg first, theres no libmycodec,
>> build libmycodec first, theres no libavutil
>> now of course this can be worked around by building ffmpeg twice
>> But this is not documented, not suggested, not tested and not considered
>> of course myself spliting out libpostproc made me realize this issue. But
>> its a much broader problem than libpostproc. For libpostproc i can just
>> copy everything and remove all libavutil dependancies
>> And even without that it builds and works fine and all but only because i had
>> a prior build libavutil installed from before.
>> And thats not a freak exception, the same issue happens with a demuxer
>> lib trying to use libavutil or a device lib trying to use libavutil
>> or a filter trying to use libavutil.
>> They all need libavutil built first,
>> And i think we do want people to use libavutil, if for no other reason
>> than easy sharing of things like AV_PIX_FMT and other enums and defines
>> or the ability to pass AVFrames or reference stuff around with no wraping
>> So what do people prefer ?
>> Should we just docuemnt that packagers of distros should consider
>> building libavutil in s stage1 and the then everything else in a stage2
>> so they avoid circular dependancies
>
> At least on Gentoo, which is one of the few distros where this is actually an issue at the distro level, it's relatively common practice to first build a package in a smaller version, to then install components that use it, which later can become a dependency of the package itself when it gets rebuilt next time.
>
> On binary distros libavutil can be easily split into its own package, and is even often done so already.
>
> So this definitely seems like the way that causes the least amount of disruption.
I think this case is common. Opencv depends on FFmpeg, libavfilter depends on Opencv.
Libplacebo depends on FFmpeg, and FFmpeg depends on libplacebo. libplacebo
resolved the circular dependence by header only utils, which may not work for other projects.
Sometimes I use static build to resolve the circular dependence, of course it doesn’t work
for OS distribution.
I don’t see a better solution than build multiple times, and I don’t think split libavutil out help much
for this situation.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list