Adding a Startup Movie to your Raspberry Pi

Hey All,

So I’ve been playign with trying to do a boot image or a boot movie with the Raspberry Pi for a while now, and all the comments and tips keep going back to a tutorial on how to boot a static image.  It works, but there are a lot of problems with it like failing gracefully and not returning the console window back if you aren’t booting to X.  So I decided to come up with another way.  This is based off the tutorial found here: http://www.edv-huber.com/index.php/problemloesungen/15-custom-splash-screen-for-raspberry-pi-raspbian and looks like this when finished:

Instead of using the program fbi, we will use omxplayer to playback a video file while the Raspberry Pi is booting in the background.

First off, you will want to copy the 15 to 20 second movie file to your Raspberry Pi device.  Anything shorter and the video will end before it’s finished booting and you will continue to see the kernel messages.  You can use any video file that omxplayer can play back, but I like .mov and .mp4 files.

  • You will need to edit your /boot/cmdline.txt file:
    • sudo nano /boot/cmdline.txt
  • Add quiet to the end of the line. It will look something like this:
    • dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait quiet
    • Make sure that is all on one line.
  • Press ctrl-x, type y to confirm save, then press enter to return to the command line.
  • Copy your video somewhere to the Raspberry Pi.  I keep mine in /home/pi/ and call the video video.mov
  • You will now need to create a startup script that will run omxplayer at bootup.  I have modified the script from the above link.
    • sudo nano /etc/init.d/asplashscreen

#! /bin/sh
### BEGIN INIT INFO
# Provides:          asplashscreen
# Required-Start:
# Required-Stop:
# Should-Start:      
# Default-Start:     S
# Default-Stop:
# Short-Description: Show custom splashscreen
# Description:       Show custom splashscreen
### END INIT INFO

do_start () {

    omxplayer /home/pi/video.mov &  
    exit 0
}

case "$1" in
  start|"")
    do_start
    ;;
  restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
  stop)
    # No-op
    ;;
  status)
    exit 0
    ;;
  *)
    echo "Usage: asplashscreen [start|stop]" >&2
    exit 3
    ;;
esac

:

 

  • Press ctrl-x, y to confirm saving, and press enter to return to the command line
  • Now you need to set the file to be executable
    • sudo chmod a+x /etc/init.d/asplashscreen
  • And activate it
    • sudo insserv /etc/init.d/asplashscreen

You should now be ready to go!

Reboot your Pi and enjoy the startup movie.

-Shea

33 thoughts on “Adding a Startup Movie to your Raspberry Pi

  1. Pingback: Adding a Startup Movie to your Raspberry Pi | Raspberry World

  2. Pingback: Adding a Startup Movie to your #RaspberryPi | Raspberry PiPod

  3. Hi,

    Good Tutorial,

    I Have one doubt how to connect raspberry pi to our laptop?i mean how to see our raspberry pi screen in our laptop..please tell me..i have laptop but iam unable to see output..it supports only hdmi cable…

  4. Pingback: หน้าจอบูต Raspberry Pi แบบโฉบเฉี่ยวแหวกแนว | Raspberry Pi Thailand

  5. Any idea what codec/fps/resolution/etc is best for omxplayer on the pi? I have Adobe After effects and making these kinds of little files is stupid easy/fast. Just need 2d graphics to use and the type of file output.

  6. Pingback: Custom Pi bootup screen | I like Pi

  7. Pingback: How to Add a Startup Movie to your Raspberry Pi @RaspberryPi #piday #raspberrypi « adafruit industries blog

  8. Pingback: Adding a Startup Movie to your Raspberry Pi | Shea Silverman's Blog - Pi News

  9. Pingback: Adding a Startup Movie to your Raspberry Pi

  10. It does not work.
    I followed the tutorial step by step but without success. The system throws the following error:

    Startpar: Service (s) returned failure asplashscreen failed.

    The video has a resolution of 640×480. can be a problem resolution?

    I used the windows notepad to copy the script and then I moved to the raspberry. I have reviewed many times the script, but it’s perfect. I do not know to try.

    Nobody same thing happens?

    Sorry for my bad English.

    A greeting.

    • It might be a line ending problem. Notepad will save with dos line endings and you need UNIX line endings. You should be able to easily find a windows tool to convert the file before you transfer it. Or type it in on the pi itself using an editor like nano.

  11. hi sheasilverman.com
    Do you know rememeber me ?
    5 month ago,I’m post on the my website that how to install your neogeo.
    congratulation,It publish your gaming book about raspberrypi.

    i saw your this post.
    But I’m recommendation that raspberrypi foundation mark change your mark.

    I have been change raspberrypi foundation mark.
    this movie refer.
    http://www.youtube.com/watch?feature=player_embedded&v=GUYyGKxp7Fw

    and how to post is here.
    http://www.rasplay.org/?p=6371

  12. Hello!
    Thanks for this nice article.
    I have done every step. I can see my image but, after seeing all coding; just before asking password.
    Could you tell me why my image is appearing so late?
    Is there anyway to fix this?
    Thank you so much in advance :)
    Cagri.

  13. If you turn off the logs and logo rather than “quiet” you wont get any boot messages with this method.
    “dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty3 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait logo.nologo loglevel=3″

  14. thank you for ur blog it works vrey nicely.. but i am not understanding the code is it possible giving a brief explanation for that.. thank you..

  15. i tried this word for word and nano returned”[Error writing /ect/init.d/aslashscreen : no such file or directory ]” when i tried to save,how can i fix this?

  16. its not working for me.. when ever i activate it it show error like ” insserv warning script ‘mathkernal’ missing LSB tags and overrides” how can i resolve this erroe .. plz help me ..
    thank you..

  17. its not working for me.. when ever i activate it it show error like ” insserv warning script ‘mathkernal’ missing LSB tags and overrides” how can i resolve this erroe .. plz help me ..
    thank you..

  18. Hi,

    I followed your instructions and it worked out well. I’m booting to the console, which is entered once the video ends. I need to be able to use the standard keyboard commands to control omxplayer however… but they seem to be disabled when omxplayer is run this way. Any idea how I could get that functionality back? The reason is that the only purpose of this raspberry pi is to play a video file(or series of files) in a continuous loop as soon as the unit is powered on, but I’d like to be able to pause/play or skip to the next track with the keyboard.

    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *


+ 7 = 16

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>