1

I made a script to run video's with omxplayer using omxd:

sudo service stop omxd
sleep 0.5
sudo service start omxd
sleep 0.5

omxd X
omxd h
omxd O --blank
omxd O --no-osd

VIDEOPATH='/home/pi/videos"

for entry in $VIDEOPATH/*
do
    clear
    echo A $entry > /var/run/omxctl
done

This works well, it does loop all the videos in $VIDEOPATH, however; between the video's theres a gap where it closes the player and starts a new one with the next video. Because of this you will see the desktop/terminal windows between the video's.

The display will be shown in a store, therefor it is not very nice to have this visible between the videos.

Is there any way to have this more seamless? Or any ways to hide the gap between the video's?

  • Can you write down the details of your OS? – vaha Oct 20 '16 at 14:20
  • Its the Raspberry Pi 3b 1gb – Arko Elsenaar Oct 20 '16 at 14:29
  • is it a must for you to have a desktop environment? And please share your OS details not board details. – vaha Oct 20 '16 at 16:23
1

Because there is no sufficient info about your system, I'm editing my answer based on these 4 assumptions:

  • Raspbian Jessie with Pixel runs on your system
  • Desktop Environment is not a must for you
  • Gap less than a second is OK for you
  • The pi user exists and it is a member of the video group

Set configuration to auto-login to console:

raspi-config -> Boot Options -> Desktop / CLI -> Console Autologin

Create you omx looping script. (Keep it simple keep it easy. No need for omxd etc. =)

The script will be /home/pi/myomx.sh and its content will be:

#!/bin/bash
VIDEOPATH="/home/pi/videos"
for entry in $VIDEOPATH/*
do
    omxplayer --blank "$entry" 1>/dev/null 2>/dev/null
done

By the way, to play videos continuously you may want to add an infinite loop out of the for loop.

Make the script executable:

chmod +x /home/pi/myomx.sh

Append these commands at the end of /home/pi/.bashrc:

clear
nohup /home/pi/myomx.sh &
  • I'm struggling to see how this could affect seamless playback in omxplayer, particularly when it appears to be run from the terminal rather than a GUI. Can you provide a clearer explanation? – goobering Oct 20 '16 at 14:00
  • Aha! Got you. Is there any chance you could add that explanation to your answer? Without it, it's a little unclear what the effect of disabling X is. – goobering Oct 20 '16 at 14:17
  • There is no GUI - this is all from the terminal. Between the videos you just see the desktop (toolbar, terminal window, and whatever else you had open). Then a new player pops up. – Arko Elsenaar Oct 20 '16 at 14:28
  • Crossed wires setting in here - when you say 'all from the terminal' you appear to be describing using the terminal as launched from inside the LXDE windowed GUI. When I'm talking about using the terminal, I mean without using LXDE at all/booting directly to a non-graphical terminal. The approach used in this answer may be effective for hiding on-screen elements between videos if you're working in LXDE, but it would have no effect if the omxplayer process is already being launched from a stand-alone, non-graphical terminal. – goobering Oct 20 '16 at 14:36
  • I deleted my previous comments for a fresh start. By saying seamless, Arko Elsenaar means not to show any GUI component between 2 videos. A blank screen for less than a second is acceptable for him. But goobering talks about the real meaning of seamless which is 0 time gap between 2 videos. I am talking about the former one. I will edit my answer accordingly. – vaha Oct 20 '16 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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