ProjectOne has taken a huge change in the last two weeks. Let’s talk about “the chosen one”, aka VLC Media Player, and how it has failed me for the first time in my entire life.

VLC, You Disappoint Me

VLC was intended to be the absolute core of this project, as it literally can play anything you throw at it. I have never had an issue with it up until the last 2-3 weeks.

During a change where I wanted the schedule to reside in a SQL database, I started down a path to put a VLC Media Player instance inside of a QT window so that when you are changing channels, you won’t see the flickering of the screen. I had everything exactly where I wanted it and things were working really well. Leaving the project alone for the weekend, I came back on Monday to find that half of my movies were not playing due to a “buffer deadlock” error. Stangely, I could open the file directly in VLC and it played just fine.

This caused me to do a lot of crazy things such as trying every video output available (MMAL, OpenGL, X11, etc), different command line parameters when defining the instance of VLC, to even trying different operating systems! I started with Raspbian 64-bit, continued to DietPi and Manjaro, and eventually settled on Raspbian 32-bit. Then, I ran into a huge issue where PyQt would not build when installing via pip; there were many wheel errors that I could not find a fix for. It was a miracle that it finally pushed through the build in 2 hours, however it didn’t fix the core issue: python-vlc would not play my media.

But that wasn’t enough. Nothing had changed, code was stripped down to bare essentials, yet VLC still could not successfully play videos inside or outside of a QT window.

I was getting a little worried because I had no clue on what to do, where to go from here. Documentation for python-vlc was cryptic, searching for help online was near hopeless, and like always, Discord was a bust because nobody cares about your Python problems. I was even considering selling the Pi 4 and getting a smaller x86 box due to a thought that ARM software wasn’t up to par.

Taking the Star QB Out of the Game

It felt so odd and almost wrong to admit that VLC just wasn’t up to the task. But I just happened to run across someone talking about using MPV Media Player. I then found that it was extremely flexible by itself and had an amazing Python wrapper available for it. Documentation was actually readable! So, I wrote a small test script to allow me to read in the schedule that was built and let me flip through channels. Lo and behold, it actually worked. Even the transition between each media file had a small fade in effect that looked much better than what VLC did. I don’t even need a QT window anymore as the player does so well. Finally, python-mpv has the ability run functions on specific key presses, so I’ve even managed to ditch EVDEV entirely!

VLC is officially out and MPV is in for Project One.

I’ve taken some time today to introduce simple video playback of the schedule and the ability to change channels; it works really well and it has re-ignited my passion for this project.

What’s Next

I’ve taken quite a few steps back on this due to VLC not doing its job, so I’m essentially rebuilding it from a certain point. Scheduling works just fine and it a little less dynamic than I wanted, more specific on a per channel basis, but it works. Playback is smooth and in fullscreen. Video overlay (text over video) in MPV works so much better than VLC, as I can create almost whatever I want, whatever font I want.

MPV also has the ability to read how far you are in the episode/movie in percentage form, so you can fire things off like “Show a video overlay of what’s next when it hits 98%.” Pretty neat huh?

I’m going to get all of the channels working again, verify that scheduling is doing its job, then work on some extra features, getting to a point where I can focus on the hardware build.