{"id":30859181,"url":"https://github.com/term7/raspberrypi-vlc_videolooper","last_synced_at":"2025-09-07T14:57:47.875Z","repository":{"id":153137388,"uuid":"364538786","full_name":"term7/RaspberryPi-VLC_Videolooper","owner":"term7","description":"Versatile Videolooper based on VLC for the Raspberry Pi (2B, 3B, 3B+, 4B)","archived":false,"fork":false,"pushed_at":"2025-06-21T10:45:00.000Z","size":87,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-21T11:29:02.973Z","etag":null,"topics":["autoplay","raspberry","raspberry-pi","video","video-looper","vlc","vlc-media-player","vlc-player"],"latest_commit_sha":null,"homepage":"https://term7.info/simple-videolooper-based-on-a-raspberry-pi-and-vlc","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/term7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-05T10:25:18.000Z","updated_at":"2025-06-21T10:45:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"1807ccb3-5a48-491c-bbc6-b6a3bfcb9255","html_url":"https://github.com/term7/RaspberryPi-VLC_Videolooper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/term7/RaspberryPi-VLC_Videolooper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/term7%2FRaspberryPi-VLC_Videolooper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/term7%2FRaspberryPi-VLC_Videolooper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/term7%2FRaspberryPi-VLC_Videolooper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/term7%2FRaspberryPi-VLC_Videolooper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/term7","download_url":"https://codeload.github.com/term7/RaspberryPi-VLC_Videolooper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/term7%2FRaspberryPi-VLC_Videolooper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274051981,"owners_count":25214030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoplay","raspberry","raspberry-pi","video","video-looper","vlc","vlc-media-player","vlc-player"],"created_at":"2025-09-07T14:57:23.328Z","updated_at":"2025-09-07T14:57:47.853Z","avatar_url":"https://github.com/term7.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RaspberryPi VLC_Videolooper\n*Videolooper based on VLC for the Raspberry Pi - Raspberry Pi OS (Lite)*\n\n## INTRODUCTION\n\nThis Videolooper is designed to use the commandline interface of the VLC Player. In the past VLC did not support hardware acceleratinon on the Raspberry Pi, which is why older Videolooper Projects for the Raspberry Pi use the OMXplayer instead. However this has changed. Harware acceleration and VLC is not an issue anmore, which is why we decided to develop a Videolooper based on VLC for the Raspberry Pi.\n\nThis Videolooper has been tested on the Raspberry Pi 2B, 3B, 3B+ and 4B.\nTo setup this Videolooper, follow these instuctions step by step. Feel free to make your own adjustments according to your own needs.\n\nWe think it is fun to learn, which is why we decided to write a detailed guide instead. ;-)\n\n**You can also find it on our website:**\u003cbr\u003e\n[https://term7.info/simple-videolooper-based-on-a-raspberry-pi-and-vlc/](https://term7.info/simple-videolooper-based-on-a-raspberry-pi-and-vlc/)\n\n\n### WHAT THIS VIDEOLOOPER DOES:\n\nAfter the successful implementation of these instruction, when you boot your Raspberry Pi, it will look for all video files stored in an autoplay folder, add them to a playlist and loop this playlist indefinitely. Furthermore it will look for attached USB drives, search them for video files and add them to the playlist. The USB drive has to be attached to the Raspberry Pi when it boots up. The autoplay script can easily be tweaked to accomodate a wide variety of VLC command line options.\n\n\n## SETUP\n\n- [01 Prerequisites](#01-prerequisites)\n- [02 Setup unprivileged Workstation User](#02-setup-unprivileged-workstation-user)\n- [03 Prepare Folders and Locations](#03-prepare-folders-and-locations)\n- [04 Setup USB Device Handler and Service](#04-setup-usb-device-handler-and-service)\n- [05 VLC Autoplay Service](#05-vlc-autoplay-service)\n- [06 VLC Autoplay Script](#06-vlc-autoplay-script)\n- [07 Links and Resources](#07-links-and-resources)\n\n\n# 01 Prerequisites\n\nWe recommend you work with a clean and fully updated installation of [Raspberry Pi OS Lite](https://www.raspberrypi.org/software/operating-systems/). We also recommend you create separate accounts for your standard user without sudo privileges and an admin account with sudo privileges. We have written a tutorial on our blog that covers our usual first time setup steps: [HEADLESS SETUP: basic configuration of a Raspberry Pi + hardened SECURITY](https://term7.info/intro-raspberry-pi/)\n\nIf you follow this tutorial first, installing the Videolooper will be easy.\n\n\n# 02 Setup unprivileged Workstation User\n\nOften we have been using this Videolooper on a Raspberry Pi that also had to be reachable via SSH over the internet, which is why we set up an unprivileged user account. For this guide we use a standard user account called *looper* to run our autoplay script. Next we create an *admin* account that runs all privileged processes, including the installation of required software packages. This makes it easy to change all video settings in our standard user account without needing admin rights.\n\nSIDE NOTE: Running the Videolooper in an unprivileged user account is a precaution related to [security](https://term7.info/intro-raspberry-pi/#SSH-SECURITY) and we strongly recommend you follow this setup if your Raspberry Pi is exposed to the internet. You should also consider to set up a [firewall](https://term7.info/intro-raspberry-pi/#FIREWALL) and set up [fail2ban](https://term7.info/intro-raspberry-pi/#FAIL2BAN). \n\nTo create the *admin* user with all privileges, log into your Raspberry Pi via SSH and execute the following commands (you will be asked to create a password for your new user):\n\n```\nsudo adduser admin\n```\n```\nsudo usermod -a -G adm,tty,dialout,cdrom,audio,video,plugdev,games,users,input,netdev,gpio,i2c,spi,sudo,looper admin\n```\n\nNext, replace your standard user with *admin* in /etc/sudoers.d/010_pi-nopasswd:\n```\nsudo nano /etc/sudoers.d/010_pi-nopasswd\n```\n\nEdit the file to look like this:\n```\nadmin ALL=(ALL) NOPASSWD: ALL\n```\n\nThen log into your new user account:\n```\nsu - admin\n```\n\nRemove your standard user *looper* from the sudo group:\n```\nsudo deluser looper sudo\n```\n\nReboot your Raspberry Pi and log back in via SSH.\n\nTo douple-check that the group *sudo* is missing from the list of groups run this command in a terminal window:\n```\ngroups looper\n```\n\n\n# 03 Prepare Folders and Locations\n\nMost steps during the installation require admin rights. But before we log into the *admin* account we create folder locations that will be used by our VLC Videolooper:\n\n```\nmkdir ~/Videos \u0026\u0026 mkdir ~/Videos/autoplay\n```\n```\nmkdir ~/home/workstation~/Script\n```\n\n\n# 04. Setup USB Device Handler and Service\n\nRaspberry Pi OS Lite doesn't automatically mount USB storage media by default. Since we want to be able to autoplay files from a USB drive, our next step is to enable this behavior. With a [udev](https://en.wikipedia.org/wiki/Udev) rule, [systemd](https://www.freedesktop.org/wiki/Software/systemd/) service, and a mount script, we can ensure that any attached USB stick is not just mounted at boot, but also assigned a predictable mount point.\n\nFirst, log into you admin account:\n```\nsu admin\n```\n\nThen install required software package:\n```\nsudo apt install pmount\n```\n\nNext, we create the required UDEV rule:\n```\nsudo nano /etc/udev/rules.d/usb_hook.rules\n```\n\nInsert:\n```\nACTION==\"add\", KERNEL==\"sd[a-z][0-9]\", TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"usbstick-handler@%k\"\n```\n\nNow we create a [systemd service](https://www.freedesktop.org/wiki/Software/systemd/), that monitors when a USB device is plugged in and that defines what happens, once a USB drive is inserted:\n```\nsudo nano /lib/systemd/system/usbstick-handler@.service\n```\n\nInsert:\n\n```\n[Unit]\nDescription=Automount USB drives\nBindsTo=dev-%i.device\nAfter=dev-%i.device systemd-udev-trigger.service systemd-udev-settle.service\n\n[Service]\nType=oneshot\nExecStart=/home/admin/script/automount/usbmount /dev/%I\nExecStop=sync \u0026\u0026 /usr/bin/pmount /dev/%I\n\n[Install]\nWantedBy=multi-user.target\n```\n\nThe executed script has to be very short, because udev does kill longer running scripts. Again, prepare the folder locations that we will use:\n```\nmkdir ~/script \u0026\u0026 mkdir ~/script/automount\n```\n\nWrite a script for the required mount points. Most Raspberry Pi's have 4 USB ports, so we define 4 mountpoints:\n```\nsudo nano ~/script/automount/usbmount\n```\n\nInsert:\n\n```\n#!/bin/bash\n\n# Add a small delay to ensure the USB device is fully initialized\nsleep 2\n\nfor i in {1..4}; do\n    if ! mountpoint -q /media/usb$i; then\n        /usr/bin/pmount --umask 000 --noatime -w --sync $1 usb$i\n        exit 0\n    fi\ndone\n\necho \"No mountpoints available!\"\nexit 1\n```\n\nMake the script executable:\n```\nsudo chmod +x /usr/local/bin/automount\n```\n\nSometimes you may want to play files that are larger than 4GB which is the file size limit for USB devices that are FAT32. You can get around this file size limit if you format your USB device using EXFAT. However, in order to add support for EXFAT on your Raspberry Pi, you have to install the following software package:\n\n```\nsudo apt install exfat-fuse\n```\n\nYou can reboot your Raspberry Pi now and plug in a USB drive. After the reboot SSH into your Raspberry Pi and check if you can access its contents under `/media/usb1`:\n\n```\nls /media/usb1\n```\n\nIf you see usb1 and its content, then your USB drive has been automatically mounted successfully and you are good to proceed! Otherwise retrace your previous steps and double-check your installation for mistakes.\n\n# 05 VLC Autoplay Service\n\nFinally it is time to set up your Videolooper!\n\nFirst log into your admin account and install the video player. We use VLC because it supports hardware acceleration, it does not need a graphical user interface (GUI) and it can be controlled via the command line (our autoplay script):\n```\nsudo apt install vlc\n```\n\nWe again need to create a system service that starts out Videolooper after every reboot:\n```\nsudo nano /lib/systemd/system/autoplay.service\n```\n\nInsert:\n\n```\n[Unit]\nDescription=Autoplay\nAfter=multi-user.target\n\n[Service]\nWorkingDirectory=/home/looper     \nUser=looper\nGroup=looper\nEnvironment=\"DISPLAY=:0\"\nEnvironment=\"XDG_RUNTIME_DIR=/run/user/1000\"\nExecStart=/bin/sh /home/looper/Script/autoplay.sh\n\n[Install]\nWantedBy=multi-user.target\n```\n\nFinally, we enable the VLC autoplay service with the following command:\n```\nsudo systemctl enable autoplay.service\n```\n\nDon't start the service yet. It will automatically start with the next reboot, but we have not yet created the VLC autoplay script!\n\n# 06 VLC Autoplay Script\n\nFor the next steps, make sure you are looged into your standard user account: in this example *looper*. If you named your standard user differently, please make sure you adjust the system service script and the folder paths in the autoplay script accordingly. If you are still logged into your *admin* account, type the following command to log out:\n\n```\nexit\n```\n\nNow we create the actual script that uses inotify as a trigger, creates a playlist and launches VLC to play the loop. In this script you can define all paramaters and all options that the [VLC command line](https://wiki.videolan.org/VLC_command-line_help/) has to offer. For example: we only want to play MP4, MOV and MKV files. What if you want to play an AVI? Just edit this script and add it to the list of filetypes that you want to play. Perhaps you want to rotate the video in your screen, mute the video or play a slideshow of images instead? Here you can add the required parameters. There are a lot of possibilities:\n\n```\nsudo nano ~/home/workstation~/Script/autoplay.sh\n```\n\nInsert the following content:\n\n```\n#!/bin/sh\n\n# VLC OPTIONS:\n# View all possible options: vlc -H\n\nexport XDG_RUNTIME_DIR=/run/user/1000\n\nexport AUTOPLAY=/home/looper/Videos/autoplay\nexport USB=/media/\nexport PLAYLIST=/home/looper/Videos/playlist.m3u\n\n# Video Filetypes (you can add more filetypes):\n\nFILETYPES=\"-name *.mp4 -o -name *.mov -o -name *.mkv\"\n\n# Playlist Options:\nPlaylist_Options=\"-L --started-from-file --one-instance --playlist-enqueue\"\n\n# Output Modules (edit to add options):\nVideo_Output=\"\"\n\n# Audio Options:\nAudio_Output=\"--stereo-mode 1\"\n\n# Interface Options:\nInterface_Options=\"-f --loop --no-video-title-show\"\n\n\n# Create Playlist File\n# COMMENT: change sleep to 3 if you only want to play from the internal disk to start playback earlier, 25 is only necessary in order to find the USB drive after the Pi boots up, because otherwise the script may start before the USB drive is mounted and no files will be added from USB!\n\nsleep 25\n# Create Playlist File\necho \"#EXTM3U\" \u003e \"$PLAYLIST\"\nfind \"$AUTOPLAY\" ! -iname \".*\" -type f \\( $FILETYPES \\) 2\u003e/dev/null \u003e\u003e \"$PLAYLIST\"\nfind \"$USB\" ! -iname \".*\" -type f \\( $FILETYPES \\) 2\u003e/dev/null \u003e\u003e \"$PLAYLIST\"\n\n# Play Playlist if Files Exist\nif [ -s \"$PLAYLIST\" ]; then\n   /usr/bin/vlc -I dummy -q $Video_Output $Audio_Output $Interface_Options $Playlist_Options \"$PLAYLIST\"\nelse\n   echo \"No files found to play.\"\nfi\n```\n\nAlso this script needs to be executable:\n```\nchmod +x ~/Script/autoplay.sh\n```\n\nYou can now test your Videolooper!\n\nPrepare some files on a USB media storage and/or use this command to transfer a file from your computer to the autoplay folder of your Raspberry Pi (adjust the variables to match your video file and your Pi's local IP address):\n\n```\nscp -P 6666 ~/Desktop/video.mp4 looper@192.168.1.123:/home/looper/Videos/autoplay\n```\n\nWhen the file transfer is finished, shutdown your Raspberry Pi. Then attach a screen to your Pi's HDMI port, place some video files on a USB media storage and plug it into your Raspberry Pi (if you want you can also just play from the internal autoplay folder). Connect power to boot it. After a short while it should automatically loop the video you transferred to the autoplay folder and/or the files on your USB media storage.\n\n\n# 07 Links and Resources\n\nDownload and install Raspberry Pi OS:\u003cbr\u003e\n[https://www.raspberrypi.org/software/operating-systems/](https://www.raspberrypi.org/software/operating-systems/)\u003cbr\u003e\n[https://www.raspberrypi.org/software/](https://www.raspberrypi.org/software/)\n\nRaspberry Pi Security:\u003cbr\u003e\n[https://www.raspberrypi.org/documentation/configuration/security.md](https://www.raspberrypi.org/documentation/configuration/security.md)\u003cbr\u003e\n[https://term7.info/intro-raspberry-pi/](https://term7.info/intro-raspberry-pi/)\n\nVLC Command Line:\u003cbr\u003e\n[https://wiki.videolan.org/VLC_command-line_help/](https://wiki.videolan.org/VLC_command-line_help/)\u003cbr\u003e\n[https://wiki.videolan.org/Documentation:Command_line/](https://wiki.videolan.org/Documentation:Command_line/)\n\n### **MIRRORS**\n\nThis repository is actively maintained on Codeberg:\u003cbr\u003e\nhttps://codeberg.org/term7/RaspberryPi-VLC_Videolooper\n\nChanges are pushed regularly to our Github Mirror:\u003cbr\u003e\nhttps://github.com/term7/RaspberryPi-VLC_Videolooper","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterm7%2Fraspberrypi-vlc_videolooper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterm7%2Fraspberrypi-vlc_videolooper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterm7%2Fraspberrypi-vlc_videolooper/lists"}