User avatar
makem2
Posts: 233
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

omxplayer - loop

Sat Aug 24, 2013 3:46 pm

I have been searching forums for a solution to the lack of a loop facility in omxplayer.

I find various possibilities some of which are beyond my limited programming knowledge and some just don't seem to work. One method caused my pi to run in a loop and needed rebooting to stop it.

I was wondering if a solution had been found that was now the accepted method, which I have perhaps missed, or, whether this has still not been achieved for new users like me.

ramstrong
Posts: 36
Joined: Thu Aug 15, 2013 11:14 pm
Contact: Website

Re: omxplayer - loop

Sun Aug 25, 2013 8:59 pm

I use mplayer. If you're okay with software renderer and framedrop, you may want to check it out.
Raspberry Pi Journal: http://simpletongeek.blogspot.com/p/raspberry-pi-journal-directory_4.html

User avatar
makem2
Posts: 233
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: omxplayer - loop

Wed Aug 28, 2013 2:33 pm

Tried mplayer but it does not play the .mp4 file which omxplayer plays. Also I do not see any repeat or loop options.

User avatar
RaTTuS
Posts: 10558
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: omxplayer - loop

Wed Aug 28, 2013 2:36 pm

while true; do omxplayer -o hdmi file.h264 ; sleep 1 ; done
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
makem2
Posts: 233
Joined: Tue Jul 02, 2013 9:12 am
Location: Essex
Contact: Website

Re: omxplayer - loop

Wed Aug 28, 2013 6:40 pm

Yes that works thanks. I have also come across this:

#!/bin/sh

# get rid of the cursor so we don't see it when videos are running
setterm -cursor off

# set here the path to the directory containing your videos
VIDEOPATH="/mnt/storage/videos"

# you can normally leave this alone
SERVICE="omxplayer"

# now for our infinite loop!
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
sleep 1;
else
for entry in $VIDEOPATH/*
do
clear
omxplayer -r $entry > /dev/null
done
fi
done

It also showed the desktop when it re-started so is not a true loop imo.

Return to “Beginners”