Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want my Raspberry Pi to start looping a predefined .mp4 movie (/home/oliver/awesome.mp4) as soon as possible after attaching power to the device.

This has to happen without any user interaction and I would prefer it if no OSD is distracting the playback. I want to use this next to a POS for entertainment purposes.

share|improve this question
Would you be trying to set it up as a Splash page? also how long? – Kaminara Jun 13 '12 at 0:51
The best way to do this varies depending on the distro. Which are you using? – Jivings Jun 13 '12 at 0:56
@Jivings: I assume to be using Debian. – Oliver Salzburg Jun 13 '12 at 0:57
"I want to use this next to a POS for entertainment purposes." Sorry, I couldn't help but laugh! ;) – berry120 Jul 3 '12 at 21:12
up vote 6 down vote accepted

Firstly make sure you boot straight into X. For details on this, please see this question: Auto-start X-windows / gdm on the standard Debian build

Then edit your ~/.xinitrc file. It needs to contain the command that starts your media player:

vim ~/.xinitrc
omxplayer -p -o hdmi /home/oliver/awesome.mp4

This will make the video begin as soon as X does.

share|improve this answer
If you're going down this route for the answer, could you provide details on how to make your Pi go straight into X? – recantha Feb 20 '13 at 9:08
@recantha I think that would be out of the scope of this question. But you should be able to find it somewhere on this site. – Jivings Feb 20 '13 at 17:57
I know how to do it, it would just be a more complete answer if you provided the details. – recantha Feb 25 '13 at 13:53
@recantha See this question – Jivings Feb 25 '13 at 17:48
omxplayer works also from the command line, so it's not necessary to start X at all. How about starting omxplayer from /etc/rc.local ? – Frepa Feb 26 '13 at 8:15

As proposed by Frepa, there is a faster way.

Here a way to auto login and start a script: http://www.akeric.com/blog/?p=1976

Sust make the script to start omxplayer with the video you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.