Replies: 17 comments 81 replies
-
This looks fine. Yes, I think there's no practical difference within FFmpeg between winUI and desktop. Only our own library needs a winUI dependency, although maybe we should try to remove that as well? The only reason we need UI framework reference is to handle the subtitle flicker, but IIRC we should now be able to pull subtitle samples the same way we pull audio and video samples with some adjustments? I think this is worth pursuing, it will greatly simplify our interface and will also be needed for transcoding anyway.
This is fine to be in a different package. Given that winUI/Desktop is unlikely to fix this any time soon, we should take it out of the lib.
Do we really need difference packages for transcoding only? I mean they will take out decoders which results in a smaller build footprint, but as far as I know, any transcoding tool is also capable of playback. |
Beta Was this translation helpful? Give feedback.
-
Should we also tag the Playback packages with "LGPL"? I don't really plan to do a GPL build for the playback part. It is mostly the encoders where GPL matters. On the other hand, we did not have SSL support for quite some time, because openssl had a weird license and other SSL libs were GPL. Thinking about it, IIRC there are some effects which are GPL only. |
Beta Was this translation helpful? Give feedback.
-
I had one more idea when I was working on the config class: It became really huge and confusing. Mix of decoder stuff, subtitle stuff, buffering, etc,... Should we use a 2.0 release for a rework, like breaking up the single class into multiple sub-classes? That would make it easier for devs to find the relevant settings for a specific area. |
Beta Was this translation helpful? Give feedback.
-
Currently, I think we should go with the following packages in the first step: Two lib packages:
One FFmpeg package. Possible names:
Considerations:
|
Beta Was this translation helpful? Give feedback.
-
On the topic of nuget packages, I discovered a new thing to be the central nexus of my hatred for the remaining of the year: the FFmpegInteropX.DotNet project. Its mare existence is an affront to everything good humanity stands for. I'm joking. We should discuss once and for all the problem of the output path for this project. In the current nuspec file, it says
However, the path is incorrect, the files are always generated in Release/ directory, not in the Release_WinUI directory. |
Beta Was this translation helpful? Give feedback.
-
Given all the various conversations on the topic of packaged vs unpackged, desktop vs winUI, UWP vs everything else that have happened lately, I think it is a good idea to centralize our current status. As @softworkz discovered, we do not always work correctly. This refers strictly to the master branch.
|
Beta Was this translation helpful? Give feedback.
-
I don't like the way how discussions are always hiding the latest (direct) responses, so I'm reposting as a comment:
It does (somewhat) matter for us: When somebody is watching with a laptop on batteries and then gets back and tells that with a competitor's player he can watch the double or triple amount of time before batteries are exhausted, then we have a bit of a problem. 😢
WinUI3 source hasn't been been available so far, but they've sneaked it out now, secretly and silently. It's not even announced yet. Probably they'll waiting to do this on .NET Conf next week. |
Beta Was this translation helpful? Give feedback.
-
Now that the evidence is tightening, I wanted to note that there's one line in your table which is not correct: I know it "works", but it's not intentional that it works. You could see that it doesn't work in a project with integrated packaging, only when packaging with a WAP project. This works, because the WAP project is "dumb". It treats "your" package (pre50) with the library dll as a UWP component - because that's what it is and how it is compiled like. It doesn't perform any checks whether it matches together with the other libraries being packaged. So, "currtently working" is actually a "no" - but it will be working soon of course... |
Beta Was this translation helpful? Give feedback.
-
I've cleaned up this thread a bit. Unfortunately I had to delete some conversations between me and @softworkz related to subtitles and directx which were a tad offtopic. I am shocked there is no "move" option on this forum. If you need confirmation on the directx parts we can discuss them on a different thread/topic. |
Beta Was this translation helpful? Give feedback.
-
I have updated the top post with the new lib layout, as I imagine it for v2.0. |
Beta Was this translation helpful? Give feedback.
-
Minor version bumps in ffmpeg may add APIs but not change existing ones and also not change any struct layouts and sizes (public part of structs, sometimes there's a private part which may change iirc) |
Beta Was this translation helpful? Give feedback.
-
So if we're separating the desktop from uwp build this should also deal with the wrong dll linkage. I actually had some more tests about this and it is indeed very difficult to support a single build for both uwp and desktop. |
Beta Was this translation helpful? Give feedback.
-
Why not use a single top-level package? There's no need to have separate ones and it works without blowing up download sizes: |
Beta Was this translation helpful? Give feedback.
-
VersioningThe previous/current way of versioning isn't quite straightforward, as you don't know which lib version corresponds to which FFmpeg version. For example: 5.1.123 and 6.0.123 would be at the same implementation level of FFmpegInteropX, just one compiled with FFmpeg 5.1 and the other with FFmpeg 6.0 |
Beta Was this translation helpful? Give feedback.
-
Framework PackagesAnother topic to consider might be to publish the FFmpeg packages as "Framework Packages". You have surely seen those in the project tree in Visual Studio. Just recently I came to a better understanding about how these are working and are intended for. In short: These are largely nuget packages like all others with a little bit of extra magic: When you compile an exe project, then MSBuild will copy those libraries to the output folder same like for other nugets. But the big benefit of that is that any updates to your application will not include the framework files and when the user updates your app, it will only download your app's MSIX because it already has the framework package. |
Beta Was this translation helpful? Give feedback.
-
Plot HoleI'm lifting this out of the "Versioning" thread because I think it's separate and important. You (@lukas) wrote:
At another occasion I had asked whether it wouldn't make sense to ship the lib in a single package together with FFmpeg (so everything is compiled consistently). You had responded that you want to keep the FFmpeg package separate to allow others to bring your own ffmpeg (BYOF 😉). These two things are pretty contradictive IMO. If somebody has a customized ffmpeg, it's not realistic to expect that they would adapt to the same major FFmpeg version that FFmpegInteropX is expecting for a certain release. But when you say that you don't want to do this and you want to deliberately change the FFmpeg version at whenever you like, it is no longer useful for many, because you cannot expect them to follow the same timeline of FFmpeg versions updates. Either of the two makes sense to me, the current way not that much. |
Beta Was this translation helpful? Give feedback.
-
Considering it is possible to alter media stream descriptors once the media source has been created, as we previously learned from the Microsoft fork, how about we slightly rethink the approach to HDR? At the moment, we take an optional intptr/windowId in the factory methods. This has the shortcoming that if the user moves the MPE from a window that supports HDR to a window that doesn't, or the other way around, this will result in the incorrect HDR metadata being set. Users have to recreate the ffmpeg media source with the correct window id, which is not ideal. The following 2 suggestions both relay on having support for dynamic stream descriptor changes.
|
Beta Was this translation helpful? Give feedback.
-
I have been thinking about how to structure the NuGet Packages for a 2.0 release. It should be simple to consume, but also flexible and extensible. If we introduce encoding/transcoding APIs, I would like the NuGet structure to work well with that. Where possible, we should follow established conventions.
We will have two main targets: UWP and Desktop (.NET/Win32 with or without WinUI)
The main focus of our lib is currently playback scenarios. Our ffmpeg build only includes decoders and effects. Even if we'd introduce transcoding through ffmpeg, the majority of our users will only use it for decoding. So we should not start delivering full ffmpeg builds including encoders to devs who only want to use playback. We should be prepared now to deliver different versions of FFmpeg in the future.
Proposed NuGet Structure
Current Scenario: Decoding/Playback
FFmpegInteropX.Decoding.LGPL
The top level package does not contain files, it only references the lib and the ffmpeg package, as UWP or Desktop version, depending on target platform. It is the convenience package that most devs will use. Alternatively, devs can use the Lib package, if they deliver their own custom ffmpeg build. The Lib package does not contain a ffmpeg reference. The custom build must ofc be binary compatible (at least same major version, maybe also same minor version, not sure about the latter).
For decoding, we probably do not really need a GPL package. I think it only adds a few effects. GPL only really makes sense if we deliver a full package with encoding/transcoding. Still, it's probably good to include LGPL in the lib name, so we could release a GPL version later, if we see a need for that.
Note on the FFmpeg versions:
A separate Desktop build seems to be required, as laid out by @softworkz. Altough an UWP build works fine in most scenarios, there seems to be some corner cases where UWP and Desktop dependencies collide.
BasicVideoEffect
The BasicVideoEffect should be removed from the main lib, because it introduces a dependency to Win2d, which might not be desirable for all users. It currently only works on UWP anyways. I'd still like to keep it in, since it's quite convenient (unless MediaPlaybackList is used). I would put it in a separate package:
FFmpegInteropX.UWP.Decoding.VideoAdjustmentsEffect
Potential future scenario:
"Transcoding" (remux, demux, transcode, also contains decode ofc)
FFmpegInteropX.Full.LGPL
FFmpegInteropX.Desktop.Full.GPL
Beta Was this translation helpful? Give feedback.
All reactions