|
I spent 100+ hours developing a system that performs fairly simple functionality: capture screen/connected webcams on motion detection, add overlays, and save it as .mp4. The system grew up to be a mess, so I rewrote it from scratch again spending 60+ hours, this time with functionality to capture sources in parallel.
It uses Windows Media Foundation API, written in 7000 lines of C++ code. The thing is, it doesn't work and has nasty bugs on slower systems, it crashes once in a while, sometimes has audio/video synchronization issues, etc. - the bugs are mostly very hard to reproduce. Prior to this, I considered myself to be a good programmer but it has almost made me reevaluate my decision whether I should pursue programming anymore (I'm a CS student), not to mention the toll it took on my self-worth and mental health. The question is, what's the reason after spending so much time, the end result is mostly unusable: quirkiness of Windows API, C++, or just my incompetence as a programmer? Or is multimedia programming by nature tricky? P.S. Please ignore my username and new account as I'm too embarrassed to ask from my real account that gives away my identity. |
Capturing screen/webcams and adding extra layers can get really complex. If you can't simulate and easily test it, it's a recipe for disaster.
Using MF API is quite old (relies on DirectX 9 as far as I remember).
C++/COM/multi-media is not such a good match - I always felt like puking when having to deal with COM interfaces.
I would strongly suggest you switch to C# (note: I've programmed 13 years in C++, and the last 9 in C#). There's pitfalls in this too - namely, not sure if/how easy you can easily do multimedia without UWP (Universal Windows Platform). That's a big can of worms, really hard to grasp, big learning curve, but well worth it in time (if you want to see what you can achieve, you can take a quick look at www.phot-awe.com - that's UWP).
Having said all the above - I highly suggest C#/UWP, but DO NOT expect an easy ride. It will take quite a while to be productive, but that will be time well spent.