[Nottingham] Raspberry Pi and omxplayer loop

Brian Pickford brian at brianpickford.co.uk
Wed Jul 4 16:07:48 UTC 2012


Thanks for the pointer, in taking a closer look, I found the issue and this
is now working fine.

Many thanks

#!/bin/sh -x

SERVICE='omxplayer'
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "runing" #    sleep 1
else
    omxplayer -o hdmi  United\ Springs\ Master.mp4

fi
done

The issue was: omxplayer -o hdmi *video.mp4* United\ Springs\ Master.mp4 &

I tested the script with vlc on an ubuntu box, and I must have left
this extraneous video4.mp4 from there
/me slaps forehead


On 4 July 2012 16:20, Dan Mackdermott

> Hi Brian,
>
>
> On 04/07/12 15:23, Brian Pickford wrote:
>
>> I have set up Raspbian and omxplayer from source. This is working well
>> and is doing a great job.
>>
>> I want to be able to play a single video file in an endless loop on my
>> stand at the farnbrough air show next week, but my lack of bash skills
>> id defeating me. I hope some on can spot the error and help me out ...
>>
>
> Have you tried/considered using 'wait' or running it in the foreground?
>
> e.g.
> #!/bin/sh
> while true; do
>
>   omxplayer -o hdmi video.mp4 United\ Springs\ Master.mp4 &
>   wait
> done
>
> or...
> #!/bin/sh
> while true; do
>
>   omxplayer -o hdmi video.mp4 United\ Springs\ Master.mp4 &
> done
>
>  This script and a few variants of it either return "Have a nice day ;)"
>>
>> or play the video once through then cycle the same message
>>
>
> You could also use '#!/bin/sh -x' to get more output from your script.
>
> Cheers,
>
> Dan
>
>
> ______________________________**_________________
> Nottingham mailing list
> Nottingham at mailman.lug.org.uk
> https://mailman.lug.org.uk/**mailman/listinfo/nottingham<https://mailman.lug.org.uk/mailman/listinfo/nottingham>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/nottingham/attachments/20120704/c824777d/attachment.htm>


More information about the Nottingham mailing list