I
I
Ivan2014-11-19 14:18:05
Raspberry Pi
Ivan, 2014-11-19 14:18:05

How to loop video on Raspberry Pi?

It is necessary to make a monitor + video player based on "raspberries".
Actually the video is normally played through omxplayer. For looping, a script taken from an Internet is used

#!/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 $entry > /dev/null
        done
fi
done

The problem is that the transition between videos is about 1-3 seconds. How can this be dealt with? Is it possible to buy a license for MPEG2 and use another player (eg mplayer)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question