Simple projects are daunting. They unfold with complexity the first moment you blink. I try not to blink.
In January I had just graduated from college with a comfy part-time job so I decided to dedicate my extra time to all the projects I never had the time to create while in school. I was feeling good about the Windows software development skills I had picked up for my senior design project so I decided to create a no-fuss video converter. After 4 months of development Convertophile is that no-fuss video converter.
I was running with the philosophy that I could complete a project a month. I have since abandoned that philosophy. For Convertophile, several stack components needed to be fit together precisely:
Whoops. That's not a month-long project. Regardless, I learned a lot.
Choosing a UI framework was difficult. I knew I wanted to develop a native app for Windows. That part was easy. The hard part was choosing between WPF, WinUI 3, UWP, MAUI, WinForms, and Avalonia. I knew I wanted something a little more modern, so UWP, MAUI, and WinForms get kicked out of the picture. Additionally, I like Microsoft's tools. Visual Studio, VS Code, and GitHub have treated me all too well which leads me to believe Microsoft might have a good shot at a UI framework. This eliminates Avalonia (though I have heard good things). Finally, the battle is narrowed down to WPF versus WinUI 3.
At the time, I chose WPF because of its widespread support. In hindsight I probably should have chosen WinUI 3 or at least have taken advantage of ModernWPF. WPF's UI components (termed "controls") are outdated and excruciatingly hard to style. Both frameworks use XAML, an XML UI language inspired by HTML, which can be all too difficult to master. Additionally, WinUI 3 has some quality of life features that WPF doesn't. But that goes both ways. For instance, WPF has a visual UI editor which is great for beginners learning XAML. But, good luck using it to make anything look pretty. WinUI 3 has additional padding and spacing options built into its already pretty controls. But, have fun waiting for builds to compile.
In all honesty WPF or WinUI 3 are both great picks for Windows UI development. Just for the love of god do not try to style WPF controls on your own. Use an add-on.
Whew. I tried out so many open-source C# wrappers for FFmpeg. I would not recommend it as a past-time. None of them worked consistently, intuitively, or as expected. In the end, I decided to abandon all pre-built libraries and communicate directly with FFmpeg through terminal commands. This was an interesting challenge.
Sending commands to FFmpeg was the easy part. Building the FFmpeg commands based on the user's selection of options was the hard part. I ended up creating command templates for each output file type that would be populated through a keyword system. For instance, the command template when exporting to .gif looks like this:
"-y -i [input] -vf \"fps=[output frame rate],scale=[output width]:[output height]:flags=lanczos,split[a][b];[a]palettegen=max_colors=[max colors][p];[b][p]paletteuse\" -loop [loop] -an [output]"
The user's selection of option values would be saved to dictionary keys such as "[output frame rate]" and "[output width]" so that any string containing those keys can easily be populated with the key-values. Sometimes keywords might be replaced with entire expressions when an option needs a really specific outcome.
Tackling the learning curve of XAML and developing the solution for an FFmpeg interface were the main problems I overcame during the development of Convertophile. They were not the only problems. If you would like to hear more, or have any questions about other methods used, by all means please leave a comment.
Cheers!
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.