Opened 2 years ago
Last modified 9 months ago
#69808 assigned defect
ffmpeg*: ability to select ffmpeg version as default
| Reported by: | eirnym (Eir Nym) | Owned by: | mascguy (Christopher Nielsen) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.9.3 |
| Keywords: | Cc: | ryandesign (Ryan Carsten Schmidt), laggardkernel (laggardkernel), ShadSterling (Shad Sterling), dbevans (David B. Evans), jeremyhu (Jeremy Huddleston Sequoia), mohd-akram (Mohamed Akram), barracuda156, Knapoc | |
| Port: | ffmpeg, ffmpeg-devel, ffmpeg4, ffmpeg6, ffmpeg7, ffmpeg_select |
Description
Recently I found that there's two ports: ffmpeg (version 4.x) and ffmpeg6 (version 6.x). I've installed ffmpeg6 and it can't be used as default for some reason. Please add an ability to select ffmpeg6 version as default.
There's port select mechanism to do that and I'd like to use it instead of create manual links
Change History (15)
comment:1 Changed 2 years ago by mascguy (Christopher Nielsen)
| Keywords: | ffmpeg select ffmpeg6 removed |
|---|---|
| Owner: | set to mascguy |
| Status: | new → assigned |
| Summary: | Ability to select ffmpeg version as default → ffmpeg*: ability to select ffmpeg version as default |
| Version: | → 2.9.3 |
comment:2 follow-up: 3 Changed 2 years ago by eirnym (Eir Nym)
Hi, could you explain which exactly ports it would break? The port select works perfectly in other cases as I need link only files in /opt/local/bin and not libraries.
My problem is I installed yt-dlp without a hard dependency on ffmpeg and it doesn't recognise ffmpeg6. After manual linking them to versions without 6, it works as expected.
comment:3 Changed 2 years ago by mascguy (Christopher Nielsen)
| Cc: | ryandesign added |
|---|---|
| Port: | yt-dlp added |
Replying to eirnym:
My problem is I installed
yt-dlpwithout a hard dependency onffmpegand it doesn't recognizeffmpeg6. After manual linking them to versions without6, it works as expected.
If yt-dlp is the port that you're interested in, we can add a new variant to utilize ffmpeg6. Is that the only one?
comment:4 Changed 2 years ago by eirnym (Eir Nym)
ffmpeg is a big and heavy to update dependency. I won't use variant in yt-dlp.
comment:5 follow-up: 8 Changed 2 years ago by eirnym (Eir Nym)
Could you please explain which exactly ports it would break?
The port select works perfectly in other cases as I need link only files in /opt/local/bin and not libraries.
comment:6 Changed 2 years ago by eirnym (Eir Nym)
I searched ports git to find which ports could break and found that almost none of them depends on ffmpeg executables. and I believe that almost none of these would break if ffmpeg6 will be executed rather than ffmpeg4.
comment:7 Changed 22 months ago by laggardkernel (laggardkernel)
| Cc: | laggardkernel added |
|---|
comment:8 Changed 22 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to eirnym:
ffmpeg is a big and heavy to update dependency. I won't use variant in
yt-dlp.
I don't understand your reluctance. If we add, for example, an +ffmpeg6 variant to yt-dlp, then because this variant is not enabled by default, if you try to install it, MacPorts would have to build yt-dlp from source on your system, which would take a couple seconds. But you would still be able to receive our precompiled ffmpeg6 port's binary to satisfy yt-dlp's dependency and wouldn't have to do the lengthy ffmpeg6 build from source.
Replying to eirnym:
The
port selectworks perfectly in other cases as I need link only files in /opt/local/bin and not libraries.
Adding port select functionality to the ffmpeg family of ports is a reasonable request. However, the ffmpeg port currently installs /opt/local/bin/ffmpeg, whereas you would want that path to be the symlink created by port select. So the ffmpeg port first needs to be changed so that it installs its program somewhere else, for example /opt/local/bin/ffmpeg4. There are actually several programs, and their manpages, and maybe more files, that would need the major version number appended. At that point, renaming the ffmpeg port to ffmpeg4 would make sense. And all of the ports that use the ffmpeg port would need to be updated to adapt to these changes. It's a lot of work that nobody has yet volunteered to plan and do.
Replying to eirnym:
I searched ports git to find which ports could break and found that almost none of them depends on ffmpeg executables. and I believe that almost none of these would break if ffmpeg6 will be executed rather than ffmpeg4.
I don't see how you could know that. According to the output of port echo depends:':ffmpeg($|\s)' | wc -l there are 121 ports that depend on the ffmpeg port. We do not know which of those use ffmpeg's libraries vs. which of those use ffmpeg's executables, nor which of them would break if ffmpeg were updated to version 6 or newer. The change in major ffmpeg version from 4 to 6 to now 7 indicates backward incompatibility. Deprecated library APIs have been removed as have deprecated command line options. Older ports that depend on ffmpeg may well be using those APIs and/or command line options so that updating to a major new ffmpeg version would break them. Therefore it's prudent when updating a dependency like ffmpeg to a new major version to verify that the ports that depend on it still work afterward. Since there are so many of them, and this is a lot of work, this is probably why the ffmpeg port was not updated past major version 4 for so long, and why an alternate strategy of creating separate non-conflicting ffmpeg6 and ffmpeg7 ports was pursued instead.
comment:9 Changed 22 months ago by ShadSterling (Shad Sterling)
| Cc: | ShadSterling added |
|---|
comment:10 Changed 20 months ago by percontation (Ryan Goulden)
FYI, for people (like me) who end up on this ticket while looking for "I see that <PORT> depends on ffmpeg 4.x, but I already have ffmpeg7 installed and I want it to build against that instead of 4.x":
For some purposes, you can "select ffmpeg 7.x as default" by installing ffmpeg-devel instead of ffmpeg or ffmpeg7.
Specifically: many ports, including yt-dlp, actually depend on path:bin/ffmpeg or path:lib/libavcodec.dylib or whatnot rather than port:ffmpeg; and as of a couple weeks ago, the ffmpeg-devel port installs 7.x OUTSIDE /opt/local/libexec/ffmpeg7 (i.e. it conflicts with the ffmpeg 4.x port now, instead of the ffmpeg7 port).
(I don't really have context on these developments, but I'm guessing this new ffmpeg-devel location is part of some transitional plan to improve the versioning situation for ffmpeg dependent packages.)
comment:11 Changed 17 months ago by eirnym (Eir Nym)
@ryandesign yes, I've did exactly that. I've grepped, and filtered results explicitly say that they depend on ffmpeg 7 or it's libraries.
Then I've manually checked the rest (which was only the few of them)
comment:12 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | dbevans jeremyhu mohd-akram barracuda156 added |
|---|---|
| Port: | ffmpeg ffmpeg-devel ffmpeg4 ffmpeg7 ffmpeg_select added; yt-dlp removed |
The existence of the ffmpeg-devel port at version 7.x suggests that the plan is to eventually update the ffmpeg port, currently at version 4.x, to 7.x. This would involve a lot of work verifying that all the ports that depend on the ffmpeg (or ffmpeg-devel) ports continue to work with this new version. There are currently 104 ports (in 74 portfiles) depending on port ffmpeg. If this is the plan, then there is no need for a port select mechanism for ffmpeg since there is only one approved version in the ffmpeg port and one preview version in the ffmpeg-devel port and only one of them can be active at a time.
On the other hand, the existence of the ffmpeg4, ffmpeg6, and ffmpeg7 ports suggests that the plan is to phase out the ffmpeg and ffmpeg-devel ports and update each port that uses ffmpeg to depend on the versioned ffmpeg port that it needs. This would be easier in the long run as each port using ffmpeg can update to a new major version of ffmpeg when it becomes compatible, and new major versions of ffmpeg can be added in new ports without breaking any existing ports. In this case, a port select mechanism for ffmpeg could be created. As always, the port select mechanism is for the benefit of users on the command line; it is not intended for ports (e.g. yt-dlp) to be affected by what you select.
It is confusing that two separate port versioning strategies are being employed by the ffmpeg port maintainers at the same time.
There are too many different people declaring themselves to be maintainers of the ffmpeg ports. It is probably difficult to gain consensus between them on what should be done. Ideally there should be one or two people who maintain all the ffmpeg ports and have a unified vision for them. If the port maintainers will clarify here what the vision for these ports is, then progress can be made on this ticket.
comment:14 Changed 16 months ago by eirnym (Eir Nym)
I prefer to have common version model as has been done in the rest of the MacPort system, e.g. using port select.
The quick sample for port select I've implemented in January and it's available at https://github.com/eirtools/eir-macports
comment:15 Changed 9 months ago by Knapoc
| Cc: | Knapoc added |
|---|

Symlinks are already created, so that you can use version 6 commands with a suffix of
6:We can't make
ffmpeg6the default, as it may break some older ports. But you can simply runffmpeg6,ffplay6, andffprobe6.