Stian Remvik Datagrafikk

Loop video

Looping playlist script

Now create this script named for example “videoplayer.sh”:

#!/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

Save the script, make it executable:

$ sudo chmod +x filename

and then run it as follows:

$ ./videoplayer.sh

More options can be added to the omxplayer. E.g. force audo out of minijack (-o local), hdmi(-o hdmi) or both (-o both):

The line:

omxplayer $entry > /dev/null

can be replaced with

omxplayer -o local $entry > /dev/null

Seamless Looping With Hello Video

First you need to build the libraries if you haven’t done it already. See how to do that further up.

Then edit ‘/opt/vc/src/hello_pi/hello_video/video.c’:

$ sudo nano video.c

Replace:

if(!data_len)
break;

with:

if(!data_len)
fseek(in, 0, SEEK_SET);

Ctrl-x to exit and save. Compile video.c:

$ make

Now when you run the ‘./hello_video.bin test.h264’ command, the video will loop.

"BITWaves" iOS app
Raspberry Pi Notes
"Neighbours" video installation
Electronic Vintage Bit20 concert visuals
"Late into that night, and all the following nights" installation
"Bergen Leser" installation
"Cubes" animation
NRK3 identity film
"Hush!" installation
"The sound of pictures" installation
Photographs
Concert visuals Knekklectic
Hulen Bergen posters and design
Notes on programming and other technical difficulties
-----------------------------------------------------

Multi screen video with Multiscreener on Mac
Seamless looping video player on Raspberry Pi using openFrameworks