Objective: To automatically boot a Raspberry Pi computer and play a video on endless repeat.

Raspberry Pi 2b+, LibreElec, Kodi

🎯 Goal

Boot LibreELEC → Kodi launches automatically → plays a specific video in true kiosk mode → loops forever → no GUI visible.


1️⃣ Put your video somewhere

Example:

/storage/videos/video.mp4


2️⃣ Make a “loop” folder and duplicate the video

Kodi’s RepeatAll logic works best on playlists with 2+ entries.

mkdir -p /storage/videos/loop
ln -sf /storage/videos/hawker.mp4 /storage/videos/loop/1.mp4
ln -sf /storage/videos/hawker.mp4 /storage/videos/loop/2.mp4

3️⃣ Build a playlist Kodi can load

Kodi playlists live here:
/storage/.kodi/userdata/playlists/video/

mkdir -p /storage/.kodi/userdata/playlists/video
cat > /storage/.kodi/userdata/playlists/video/kiosk.m3u <<'EOF'
/storage/videos/loop/1.mp4
/storage/videos/loop/2.mp4
EOF

4️⃣ Create /storage/.config/autostart.sh

LibreELEC runs this script at boot.

#!/bin/sh
LOG=/storage/autostart.log
echo "=== boot $(date) ===" >> "$LOG"



(
# Wait until Kodi can accept commands
c=0
while :; do
/usr/bin/kodi-send --action='Action(Nop)' >/dev/null 2>&1 && break
c=$((c+1)); [ $c -ge 120 ] && echo "Gave up waiting" >> "$LOG" && exit 0
sleep 0.5
done
echo "Kodi responded after $c tries" >> "$LOG"
sleep 5



# Play playlist, loop, fullscreen, hide GUI
/usr/bin/kodi-send --action='PlayMedia("/storage/.kodi/userdata/playlists/video/kiosk.m3u",noresume)'
sleep 1
/usr/bin/kodi-send --action='PlayerControl(RepeatAll)'
/usr/bin/kodi-send --action='ActivateWindow(FullscreenVideo)'
/usr/bin/kodi-send --action='Dialog.Close(all,true)'



# Safety retry in case startup was too early
sleep 6
/usr/bin/kodi-send --action='PlayMedia("/storage/.kodi/userdata/playlists/video/kiosk.m3u",noresume)'
sleep 1
/usr/bin/kodi-send --action='PlayerControl(RepeatAll)'
/usr/bin/kodi-send --action='ActivateWindow(FullscreenVideo)'
/usr/bin/kodi-send --action='Dialog.Close(all,true)'



echo "Playback commands sent" >> "$LOG"
) &


Make it executable:

chmod +x /storage/.config/autostart.sh

5️⃣ Reboot & Done

LibreELEC boots → Kodi starts → video plays fullscreen → loops forever with no GUI.