Use
Playing Videos
After installation, Video Looper is configured to play videos off of USB drives inserted in the Raspberry Pi. The default video player, VLC, can play most videos encoded with the H.264 video codec and in a video format with an extension like .avi, .mov, .mkv, .mp4, or .m4v. You can even play 720p and 1080p files because VLC will use the Pi's GPU (graphics processing unit) to efficiently play videos!
With Video Looper running, if you insert a USB stick with videos on it, a message will display with the number of detected movies and a 5 second countdown as seen above.
If more than one video is found, then each one will be played in alphabetical order by filename. Once the last video has played, Video Looper will loop back to the first video and play all videos again in order repeatedly.
If only one video is available, it will play continually in a loop as shown in the gif below.
Audio
When videos are playing, audio will be output on whichever audio output is selected in the system settings. Right click the speaker icon in the top right corner of the start bar to see a list of available sound outputs and click on the one you want audio to play from.
Configuration
You can customize the behavior of video looper by changing settings in its configuration file. If you only need to play videos off of USB drives then you don't need to change the configuration, everything is ready to go after installation! However if you'd like to play videos from a directory on the SD card, display images instead of videos, disable the on-screen display messages, and more then continue reading.
There are a few different possible ways to edit the configuration file. If you have SSH or direct access to the Pi you can use the nano editor. Or if you prefer GUI apps, use the builtin text editor, mousepad.
Here are the commands to open the file in an editor:
# Nano editor via SSH or terminal sudo nano /boot/video_looper.ini # GUI Text editor via direct access only sudo mousepad /boot/video_looper.ini
The configuration file is stored in the /boot/ folder on the Raspberry Pi's SD card which means you can also edit it directly on your computer instead of the Pi. Shutdown your Raspberry Pi (see this page if you aren't sure how), pull out the micro SD card, and insert it into your computer. After your computer displays the files on the card, open the video_looper.ini file in a text editor.
At the top of the configuration file you'll see text like:
# Main configuration file for video_looper. # The video_looper works right out of the box by playing any video files that # are in the root directory of an attached USB drive. # In this file you can change a lot of the video_looper's behavior, like what # video player is used or where it looks for media files. # Lines that begin with # are comments that will be ignored. # Uncomment (=activate) a line by removing its preceding # character. # Use ./reload.sh to restart the video_looper with any changed settings. # Video_looper configuration block follows. [video_looper] # Set which video player will be used to play media files. Only vlcplayer is supported at this time. # The image_player only displays images and for the duration configured in this file under the "image_player" section. # The default is vlcplayer. video_player = vlcplayer #video_player = image_player # File Reader Location # Where to find media files. Can be usb_drive, directory or usb_drive_copymode. # When using usb_drive any USB stick inserted in to the Pi will be automatically # mounted and searched for media files (only in the root directory). # Alternatively the directory option will search only a specified directory on the SD # card for media files. # You can change the directory to be used in the [directory] section below. # The default is usb_drive. file_reader = usb_drive #file_reader = directory #file_reader = usb_drive_copymode
Lines that start with # are comments which will be completely ignored. Many of the settings include commented out lines that show the various options available. Read the comments to help understand what options are available in the configuration file.
Two of the most common options to change are at the top of the file, the video_player option and the file_reader option.
Video Player
video_player controls whether the looper will play videos or images. vlcplayer the only valid choice for videos, and image_player is for showing images instead of videos. In the original Pi Video Looper, there were two different video players to choose from, with differing behaviors.
If you'd like to change from videos to images, update the configuration to look like this (notice the vlcplayer line is commented and the image_player line is uncommented):
#video_player = vlcplayer video_player = image_player
File Reader
file_reader controls where videos are found. Either on USB drives or from a directory on the Raspberry Pi. The valid options are:
-
usb_driveis the default and will search all attached USB drives for videos. You can plug in a USB drive and it will automatically be searched for files to play. -
directorywill search a single directory on the Raspberry Pi for movies. This is useful if you don't want to have a USB drive attached to the Raspberry Pi, or don't need to change videos frequently. -
usb_drive_copymodeis like a combination of the two. It will play files that are found in the specified directory on the Pi's SDCard. When a USB Drive is inserted, it will copy files from the USB Drive to the SD Card in the specified directory. Further configuration allows replacing all existing media, or adding to the new files while keeping the old. See the[copymode]section in the configuration file for more details.
To change the file_reader mode, simply uncomment the type you want to use, and comment the rest. For example this would enable the directory file reader mode.
#file_reader = usb_drive file_reader = directory #file_reader = usb_drive_copymode
Directory
By default, the directory mode will look for videos in the Videos folder in the users home, i.e. /home/pi/Videos/. To choose a different folder that will be used for media, scroll down to the [directory] part of the configuration and change the value of the path configuration to the location your videos are stored.
# Directory file reader configuration follows. [directory] # The path to search for movies when using the directory file reader. path = /home/pi/Videos
Keyboard Hotkeys
The following keyboard hotkeys are supported to control the Video Looper.
- ESC - Exit the Video Looper, however systemd will automatically restart it after a few seconds by default if the service is enabled.
- K - Skip ahead to the next media file.
- B - Go back to the previous media file.
- S - Stop or start video playback.
- Spacebar - Pause or resume video playback.
- P - Stop playing and shut the Pi down. Be sure to shut down before you unplug the Pi!
GPIO Inputs
You can also assign triggered actions based on GPIO pins with buttons, PIR motion sensors, or other components with basic HIGH/LOW pin output. To set up GPIO triggers, look for the gpio_pin_map variable in the [control] section of the configuration file. It's value can be set to a key/value pairing of GPIO pins to trigger actions. Pins are the keys and are specified by their Blinka board object names like D4, D7, D18 etc...
Actions are triggered when the specified pin is pulled LOW. The values can be a number or string containing one of following trigger actions.
- Media file index - An int number like
0, or3that specifies the index of the media item to launch. When the pin is pulled LOW the video will play. - Jump forward or back - A string with a
+or-followed by a number. For example"+2"or"-1". When triggered it will jump forward or backwards in the playlist by the specified number. - Video filename - A string containing the name of a video file to play when triggered. i.e.
"video.mp4". The video must be in the playback directory or USB drive. - Keyboard hotkey - A string containing a pygame key event specifier of one of the keys for the keyboard hotkeys listed above. Valid values are:
"K_SPACE","K_ESCAPE","K_p","K_k","K_b", or"K_s",
There are more setting in the full configuration file which will change Video Looper's behavior and appearance, like if it prints messages on the screen, the color of the background, and more. It's not common to change these settings but you can read through the the comments in the configuration to learn more about them.
Once you've finished editing the configuration file, you should save it and close the editor. If you edited the file on your computer, dismount the micro SD card from your computer, and insert the card back in the Raspberry Pi. Then boot up the Raspberry Pi. The Video Looper should load the updated configuration.
To force the Video Looper to reload the latest configuration at any time, you can use the reload script that is included in the repo.
cd ~/pi_video_looper2/ sudo ./reload.sh
Disable Video Looper
Once installed, Video Looper will run automatically every time the Raspberry Pi is booted. If you'd like to stop or disable Video Looper, you have a few options available.
To temporarily stop Video Looper, connect to the Raspberry Pi in a terminal/SSH session and run this command.
sudo systemctl stop video_looper.service
After a moment, Video Looper should stop playing and exit. Video Looper will not run again until the Raspberry Pi is rebooted, or the service is started again.
To permanently disable Video Looper, i.e. to prevent it from ever starting on boot again, you can run the disable.sh script included with the Video Looper code. Connect to the Raspberry Pi in a terminal/SSH session and navigate to the folder where pi_video_looper2 was downloaded. If you followed the installation in this guide then these commands.
cd ~/pi_video_looper2 sudo ./disable.sh
Don't worry if you see an error message displayed that video looper is already stopped (this might happen if video looper isn't running when its disabled). After running the script above video looper will be disabled and should not run on boot.
To enable video looper again later, just run the enable.sh script.
cd ~/pi_video_looper2/ sudo ./enable.sh
Uninstall
To completely uninstall Video Looper, and cleanup configuration/virtual environment files, use the uninstall.sh script. If you use a username other than the default "pi", add the --user argument followed by your username.
cd ~/pi_video_looper2/ sudo ./uninstall.sh # For usernames other than pi sudo ./uninstall .sh --user myusername
Shutting Down the Raspberry Pi
Once you're up and running with the video looper you might be curious how to shut down your Raspberry Pi. Resist the temptation to just yank out the power cord as you could corrupt the Pi's SD card and require a full operating system and video looper reinstallation! Instead, you should cleanly shutdown the Pi so that there is no chance of corrupting the operating system.
To cleanly shut down the Pi, you can use either connect to it via SSH and run sudo shutdown now, or connect a USB keyboard and press the P key, which is set as a hotkey for shutting down.
Again unless you absolutely can't avoid it, do not abruptly remove power from the Raspberry Pi without cleanly shutting it down first!
Page last edited December 01, 2025
Text editor powered by tinymce.