Playing mp4 video files to the console framebuffer can be done with the VLC application, which is pre-loaded by default in the Raspberry Pi OS. In order to get the video to the matrix panel, we'll use the Mirror Console example from the previous page, so check that out first if you haven't already. The trick is to keep the Mirror Console example running and then play the video so that the video is mirrored to the matrix panels.
You can run the fbmirror_scaled.py script via SSH, or directly from the console with a keyboard. If you run it directly from the console then you'll need to add &
to the end of the command to run it in the background so that you can get a new prompt to run the VLC command.
source ~/venvs/blinka_venv/bin/activate cd ~/Adafruit_Blinka_Raspberry_Pi5_PioMatter/examples # Via SSH python fbmirror_scaled.py --scale 16 --width 128 --height 64 --orentation R180 # Direct Console python fbmirror_scaled.py --scale 16 --width 128 --height 64 --orientation R180 &
If you ran it directly in the console, and want to stop the mirroring process you can do so using the ps
and kill
commands. First run ps
and look for the row with "python" in the CMD column, follow that row to the PID column and note the PID number for the process. Then run kill [number]
swapping in the pid number of the process.
The VLC command must be run directly from the console, not via SSH.
Once the display is being mirrored, all that's left is to start up the video. We must use the --vout fb
argument to tell VLC to send the video output to the framebuffer. It can also be handy to modify the brightness of the video to darken it some if you see lines or other artifacts in the bright regions of your video. That can be done by adding --video-filter=adjust --brightness=0.85
to the command before the video is specified. Change the 0.85
to whatever brightness percentage you want.
The whole command looks like this.
vlc --vout fb --video-filter=adjust --brightness=0.85 your_video_file.mp4
You can stop the video early by pressing Ctrl-C. If you let the entire video play then it will bring you back to the terminal after it's over, but it will still be waiting for you to exit VLC by pressing Ctrl-C.
The code for this is the fbmirror_scaled.py script from the previous page.
Page last edited February 17, 2025
Text editor powered by tinymce.