Omxplayer + Raspberry Pi


Hey all!

I’m working on a 4 channel video installation for the BFA show in a couple weeks & am using Raspberry Pi’s as media players connected to old CRT monitors (HDMI --> VGA).

I’m new to the Linux OS so I’ve been wracking by brain sorting through different forums trying to get omxplayer installed / running. I recently installed Raspbian on all of my SD cards so the OS is up to date & boots to the GUI . My movie files are in .mp4 format (bc I believe that is one of the supported formats in omxplayer??). They are 20-40 seconds long each (no sound) & I am looking to have them run on a loop.

I have tried converting my movies into animated gifs which I rarely have success opening up in the built in image viewer bc a) they have crashed my pi & b) I am running into the issue of my screen blacking out after 5-10 min if / when they do run for that long.

I’m not sure if omxplayer overrides the screen blanking…but essentially I am just looking for a simple way to get these moving images up and running in one format or another on a seamless loop w/o the screen timing out on me.

Thankxx in advance!
// Christine Janokowicz


@notandrewkaye thoughts?


@jvcleave Do you have “best-encoding” settings you could recommend?


I have an omxplayer script that loops videos from a folder on my github:

The readme should give you enough to get this going, but let me know if you have any problems.

By default Raspbian includes omxplayer so you shouldn’t need to install anything.

As far as encoding settings I’d say a low bitrate h.264 mp4 should have great results.


I use MPEG Streamclip and usually start with the default h.264 settings. I have gotten both AAC and PCM encoded audio to work well. At one point only PCM was able to be used with hardware acceleration - I am not sure if that is still the case.

Building omxplayer is a huge pain. It now requires boost and a special version of gcc. I just went through this as I needed to test out some of their seeking functionality. If anyone ever needs to do this I recommend trying this setup first. It’s basically an entire cross-compiler setup with omxplayer in mind.


Wow, that’s a beast to set up a custom build @jvcleave. @armpitrubber I’ll bet if you use @notandrewkaye’s script and @jvcleave build settings you’ll be set.


Also, just as an aside, it will likely not be possible to get a completely seamless loop using omxplayer (unless you do something really tricky like this). If you want there to be less blanks during the loop, I’d recommend making a really long version of your video with the loops incorporated. That way you’d get a blank once per hour (or however long you want to make it). Believe it or not, I take the long video approach with RPi players and a script similar to @notandrewkaye to run this installation now

If you absolutely must have a seamless loop, then you’ll probably have to roll a custom player using @jvcleave’s ofxOMXPlayer. There are examples in there that have seamless looping, but are slightly more complicated to set up, thus I’d vote for the long video and script approach.


Cool so I got each video file to finally run in omxplayer so that’s progress!

As far as the looping goes I transferred over the script into my /home/pi folder and ran the commands in the readme on the first pi & restarted…now it is just booting up to a black screen so I’m not sure where to go from here / where I could have gone wrong?


++ I am looking online for solutions etc etc & see there is a version of VLC player for r.pi has anyone used that / had success running it for long periods of time on a loop?
I’m having all sorts of issues doing all app installs / updates so I’m not sure if it is worth going into troubleshooting why VLC keeps aborting install.


Did you get any error messages that could give a clue?


I’d recommend sticking w/ omxplayer. It’s tried and true.


No error messages as far as I could tell. Once I finished everything I just did a simple reboot and when it goes to boot to the GUI all I’m getting is a black screen. I may be interpreting what the end steps of the readme are trying to execute incorrectly, but I’m under the impression that I set it up so it automatically loads the file + starts playing on boot?? Could there be an error in finding the file / if so is there any keyboard shortcut to try to get back to the GUI?


@armpitrubber it’s difficult to say without seeing the machine. That said, if you stop by the ATS grad talks tomorrow (rm 417) @ 4:15pm, (and have your setup running somewhere nearby) you just might be able to convince someone (likely me or @notandrewkaye) to give it a quick look after the talks :smile:


There is a PR with looping functionality so you may want to try that

Some are saying they see issues with the audio but that may be format related - looking at the implementation it is the right way to do it (and what works with ofxOMXPlayer)


Sorry all, I’ve been a bit out of the loop on this issue.

I can definitely lend a hand tomorrow at 4 or for a few minutes after the talks.


For those following, we got video looping!



That is hilarious – @mikewesthad this seems somehow relevant to our conversation today … no?


++, very yes. I love xkcd.


Hey all it’s been a bit but as Andrew mentioned we got the video’s looping!
Just a closing footnote for reference / what we did to solve the issue…
Pretty sure that the black screen on startup was from using the startup script at the end of the readme + error accessing the file to start looping so it was just booting to the black background but wasn’t able to find the video to start playing.
We just started from new on another sd card & am using the looping script on his github + an hour long video for minimal flickering bc of the loop restarting.
I’m skipping the startup script bc Sullivan gallery is cool with letting me run them 24/7 for a few weeks so I didn’t mess around with any of steps past the looping script instructions on the readme.
Thanks again everyone!