Boot up video for Klipper Screen
Note: Since this blog post was released the package for omxplayer has been deprecated, and so far I have not found a good replacement, meaning that this process will work only if you decide to install an old OS with omxplayer support.
I’m all in when it comes to making my things a bit more unique.
I recently did a mod on my Voron 2.4 which was to add a touch screen and klipper screen to control my printer, which is great, and I then discovered a way to turn off all the booting information you normally get, and turn it into a nice video.
My plan is to show you how to do the same in case you want to copy this work.
What you need:
- Your raspberry PI already configured and running klipper screen
- A touch device connected to your PI
- A computer to access your pi through SSH
The work can be separated into two tasks:
- -Is to remove all the current boot information from the screen
- -To add the video
Let's start with 1:
In order to get a quiet boot up screen, you need to edit three files:
In the first one you just need to add disable_splash=1 at the end of /boot/config.txt
Remember to access these files as root with sudo otherwise you won’t be able to change them.
In the second /boot/cmdline.txt, you want to add:
consoleblank=1 logo.nologo quiet loglevel=0 plymouth.enable=0 vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fastboot noatime nodiratime noram
At the end of the line. In this file it is important that you don’t insert extra spaces, or new lines or anything. This is a one line file and should keep it like that.
And finally in /etc/rc.local
Just add dmesg --console-off at the end before the exit 0
Let's add our video now.
First let’s install a video player that doesn’t require a full GUI, and for that we install omxplasyer
Sudo apt-get install omxplayer
Secondly, upload a couple of videos to the raspberry pi. Here I have realized that even if I’m going to display my video in a 16:9 aspect ratio (widescreen), I need the video saved in 4:3, and I’m using 960x720 of resolution, but I think the max is 1080p. I know for sure that higher resolution will just not display.
What video and how to get them in this aspect ratio is out of scope of this tutorial, but I just took some videos I had and transcoded them using handbrake to the resolution I wanted.
There are a couple of different times where you can show your video during the boot process.
I’ve chosen to actually not only add one video, but 2, and I’ll explain why.
The booting process for this PI is kind of slow, and because of that you either need a long enough video to run while everything is happening, or you loop a short video, or you play 2 or more videos.
The very perfect way to do it will be to time out how long your booting process takes, and use a video of the same length. But I will just do 2 videos in different booting stages and hope for the best.
The first one will be an animated logo from my company, to use as soon as possible. I’ll do this by creating a service which starts early,, not waiting for network, or other services to be up.
For this you create a file in /etc/systemd/system/ called splash.service with this information:
ExecStart=/usr/bin/omxplayer -b /path/to/video.mp4 &
Where you replace /path/to/video.mp4 with your own video.
**if you want the video to loop a –loop to the omxplayer parameters
(ExecStart=/usr/bin/omxplayer -b –loop /path/to/video.mp4)
Then you save it an enable it with sudo systemctl enable splash
I then add the second video in /etc/rc.local to cover more of the booting time.
I do this by adding
omxplayer /home/pi/bootvideo_36sec.mov &
Before the exit 0
Save and reboot and you should have a nice new boot-up sequence.
If something goes wrong, check spelling, spaces, and as I said with cmline.txt that everything is in one line in that specific file.