RandomEngy / VidCoder

A Blu-ray, DVD and video file transcoder for Windows.
http://vidcoder.net
GNU General Public License v2.0
701 stars 42 forks source link

Build with .Net Core to enable use on linux #257

Open mrlenny opened 7 years ago

mrlenny commented 7 years ago

I see that you have some WPF elements in there, but perhaps you could remove/replace those, and build in .Net core so that this can be used in linux?

RandomEngy commented 7 years ago

Xamarin is traditionally the way to get C# UI applications running on other platforms and Xamarin doesn't support Linux. They've announced Linux support for Xamarin Forms 3.0, but that would still require:

1) Migrating views to XAML standard 2) Refactoring viewmodels to be compliant with .NET core 3) Migrating all the custom/non-standard UI I've made for VidCoder, like the preview bar, chapter/range picker, split button, color picker, toolbar 4) Making Linux versions of all that non-standard UI

It it does happen, it would be a long way off. It would also conflict with the windows docking feature I want to add.

In the meantime, you can use HandBrake.

flip111 commented 5 years ago

Might want to try to let it run on mono instead of .NET core

https://medium.com/@hudsonmendes/build-net-4-5-on-linux-in-5-minutes-and-see-what-it-is-like-848ea45fc667

Not everybody is so enthusiastic about mono reading this post https://stackoverflow.com/a/39740592/1833322 about web apps.

However perhaps it runs without too much effort on mono, then see if it performs well enough.

@RandomEngy Could you give an update of the 4 points you mentioned if there have been any changes about them since the date you posted them?

RandomEngy commented 5 years ago

The real sticking point here is the UI. A large portion of VidCoder is the UI and that's currently written in WPF. WPF simply cannot run on any other OS due to the extensive Windows calls it makes.

So that means rewriting for Xamarin Forms or cooking up some alternate UI for those platforms. There are additional difficulties as VidCoder relies on tool/helper windows and those don't have great support on other platforms. It's why HandBrake is constrained and can't pick up many of the UI improvements I've made.

flip111 commented 5 years ago

@RandomEngy well explained. So the sticking point is WPF. Yes that's unfortunate. Could you tell what is the most complicated UI widget you have created that would be hardest to port?

I've looked around here are a few UI toolkits i found (this is mainly for my own reference at this point).

RandomEngy commented 5 years ago

There would also need to be a lot of thought put into how the main code core interacts with the UI. If it's going to be MVVM, there would need to be a bunch of prep work to make the viewmodel/model classes completely independent of Windows and portable. For example the Color type is in a Windows-specific DLL. If it's not MVVM, the rework would be even more difficult. I don't know what UI update patterns those UI libraries support.

flip111 commented 5 years ago

All of the frameworks don't support Ribbon out of the box as it looks like. The best chance is to use a language agnostic framework such as GTK or Qt with low level bindings. The GTK effort seemed to be abandoned more than 10 years ago. Qt seems more promising. Other than that people are discussing.

I don't think it's worth it at this moment. But it's interesting to explore what's possible.

flip111 commented 5 years ago

Looks like WPF is coming to .NET core 3 https://devblogs.microsoft.com/dotnet/net-core-3-and-support-for-windows-desktop-applications/ perhaps with this little modifications to the source are needed to make it cross platform

RandomEngy commented 5 years ago

That means WPF can run on .NET Core but it doesn't mean that WPF can run on non-windows platforms. I am planning on migrating VidCoder onto .NET Core but not planning on migrating off of WPF.