FFmpeg.AutoGen icon indicating copy to clipboard operation
FFmpeg.AutoGen copied to clipboard

[Question] Targeting .NET 7.0 Directly

Open SuRGeoNix opened this issue 1 year ago • 4 comments

Hi @Ruslan-B, I was wondering if we could get better performance by compiling directly to .NET 6+ instead of just using .NET Standard.

I asked this in stackoverflow long time ago but I never got an answer.

SuRGeoNix avatar Mar 22 '23 11:03 SuRGeoNix

FFmpeg.AutoGen has no dependency, so without writing some .NET 6 specific code it makes no sense to add .NET6 tfw. The result will be the same anyway.

As far as I know when a package "A" targets netstandard, and it is using a package "B", which has netstandard and net6 version (and the net6 veresion is really contains some net6 improvements) it will use the netstandard version of "B". So in this case it makes sense to add net6 tfw to package "A", since it will inculde the net6 version of "B". But this is not the case with FFmpeg.AutoGen.

Anyway I support adding net6+ target if there is a useful improvement in FFmpeg.AutoGen which needs net6+.

zgabi avatar Mar 22 '23 11:03 zgabi

@zgabi Yes, I'm talking about the case that an App or Package written in .NET6+ is targeting FFmpeg.Autogen. In this case (I think!) you will get much better performance if you use a .NET6+ FFmpeg.Autogen compiled dll.

SuRGeoNix avatar Mar 22 '23 11:03 SuRGeoNix

It is useful only when FFmpeg.Autogen takes advantage of the new features of .net 6. So changing only the tfw (without code modifiications, contitional compilations) makes no sense.

zgabi avatar Mar 22 '23 12:03 zgabi

.NET 7 has newer interop API - I am working now on adding .NET7 as another target platform.

Ruslan-B avatar Mar 22 '23 12:03 Ruslan-B