denjell
Posts: 25
Joined: Sun Feb 10, 2013 4:00 pm

Re: seamless looping

Tue Mar 26, 2013 3:29 pm

I greatly sympathize with you. Which is why I am preparing a hexxeh based distro that should get you up and runnin. Bear with me, I am doing this in my non-existent free time, so it could take a few days... BRB.

monnte
Posts: 8
Joined: Fri Mar 08, 2013 9:11 pm

Re: seamless looping

Thu Mar 28, 2013 4:36 pm

Hey Deniel, hoping the best from u ;)
i i`m now on screenly , but i had some stop working , had to reload the sowftware 3 times in one week, not sure yet is it rpi problem or software problem, if i could have another solution to try with sound, could bet very good...

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Sat Mar 30, 2013 9:42 am

Thanks for the work everybody!
I got this working.

Is there a way to quit omxplayer trough ssh?

"killall omxplayer.bin"
restarts the video

denjell
Posts: 25
Joined: Sun Feb 10, 2013 4:00 pm

Re: seamless looping

Sat Mar 30, 2013 12:16 pm

that's easy - just track down the pid of the autoloop.sh and kill that.

use:

$ top

once you have found the pid like 1898 press Q
and then enter

$ sudo kill -9 *_pid_*

DO NOT TYPE THE $'s -> they are just there to show you the command line, and DO switch *_pid_* with whatever pid is associated with the script you want to kill.

good hunting.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Sat Mar 30, 2013 3:22 pm

great thnx,
using "$ htop" you kan kill the process by selection.

I have updated the firmware on the pi and have no more audio pops at start and end!
Looks like I will be able to buy some more pi's to apply at our artcentre. :-)
Next step would be dummy proof content changing. (wireless)

Anyone any idea what the best solution could be?
Could the videofilename be scripted with a wildcard so a change in filename would not require a remake of the scripts? (or a reference to any content in a specified folder)

denjell
Posts: 25
Joined: Sun Feb 10, 2013 4:00 pm

Re: seamless looping

Sat Mar 30, 2013 4:56 pm

your best bet in this case is to use rsync.
http://www.cyberciti.biz/tips/linux-use ... ries.html
i do have one warning for you, and the solution i presented is not even perfect in a perfect world, because you WILL have SD cards fail on you sooner rather than later, especially if they are always on (exhibition), being written to frequently (swapfile) and have a higher speed rating (8+).

the safe money would be on using a combination of SD card image and USB stick. Basically you make a batch of SD Cards with dd and host the media files on the USB stick. It would be trivial to change the looping script to lookup and loop whatever file is on the USB stick. You can still use RSYNC to put the media file on the SD card, or an assistant / non-guru can simply switch out the usb stick.

Anyway, the idea is to reduce writes to the SD card and thereby prolong its life.

cheers

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Sat Mar 30, 2013 5:56 pm

The setup will be 20+ pi's scattered in a huge building.
Some screens+pi's not easely accessible.
Some will need to change content once a day /week or not at all.

i will try to include crontab jobs for disabling hdmi output so screens can go in standby +...
I would like to have a shared folder on our server with a folder per pi. or they stream from their folder or they sync with their folder.
Then i just need to figure out how to let each "play content of spec folder" instead of filename.mp4
So anyone can just drop a file in the right folder on our server.


or does this seem like a bad idea?

denjell
Posts: 25
Joined: Sun Feb 10, 2013 4:00 pm

Re: seamless looping

Sat Mar 30, 2013 6:41 pm

nope - sounds good ;)

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Tue May 21, 2013 3:33 am

Hi all,
I have been following this thread and have had a crash course in Raspberry Pi in the last few days. I'll get stuck for about half an hour, Google the problem and then learn something new. I am currently using the latest version of Wheezy and would like a simple video looping option at startup and now thinking that it would be best to host the videos on a USB stick.

Is there an update to this thread as it has been rather quiet and will I need to install Debian to get seamless looping more effective? I would like the option to loop multiple videos if possible and instructions on referencing a folder on a usb stick.

Cheers!
Adam.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Tue May 21, 2013 7:43 am

There is probably a better way but this is quite easy:

use this branch of omxplayer: https://github.com/huceke/omxplayer/pull/127
it has a -L parameter for looping.

just copy,past and replace the folders on your sd card.
make a fstab entry to always mount the stick on /media/usbdrive
use a script with "omxplayer -L /media/usbdrive/*" to play your files (ex videoloop.sh)
create a .desktop file in /home/pi/.config/autostart/xxxx.desktop (make it executable)
with "Exec=bash "/home/pi/videoloop.sh" (make it executable)

now when the pi starts xserver on boot it will execute the .desktopfile which in turn runs videoloop.sh

I use this on 26 pi's in videoinstallations :-)

one tip: do NOT overclock the pi, it will corrupt the sdcard to easely.

i have made it so that you can pull the stick and the loop stops , connect the stick and the loop starts trough udev rules, let me know if you need this.

----------------------------.desktop file----------------------
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=autostartkimscript
Comment=startkimscript
Exec=bash "/home/pi/videoloop.sh"
StartupNotify=false
Terminal=false
Hidden=false
-------------------------------

----------------------videoloop.sh-----------------------
#!/bin/bash
omxplayer -L /media/usbdrive/*
----------------------------------------------------------------

----------fstab-----------------
/dev/sda1 /media/usbdrive auto auto,user,rw,exec 00
---------------------------------

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Tue May 21, 2013 9:17 am

Brilliant!

With my crash course in Raspberry Pi knowledge, I will attempt this tonight and let you know how I go.

Sorry to be so vague, but how do I install the Huceke version of omxplayer on my Pi? I now have the Pi connected to my router. Can I download direct via Wheezy?

I have been able to get a video running from a USB stick, created the scripts, but was unsure about installing the Huceke version of omxplayer.

Cheers!
Adam.

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Sun May 26, 2013 7:31 am

Heya nolman,
Intensive week of Raspberry Pi trial and error. I now have Huceke omxplayer installed and all the scripts you specify. Usbdrive is mounted each time, videoloop.sh can be run manually, I have my desktop file created, but when I start the Raspberry Pi, it goes straight to a prompt. Nothing is starting automatically and i'm not getting any errors. What am I not doing correctly?

Cheers!
Adam.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Sun May 26, 2013 9:28 am

Is your rpi setup to boot to desktop?
the .desktop file in autostart will only execute when xserver and the destop are started.
do "sudo raspi-config" to set it up.

You can start omxplayer without xserver but you will have to add the command to bash.rc or .profile ,... not realy sure.

let me know if it works

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Sun May 26, 2013 2:21 pm

Hehe I worked this out after I posted the message when I ran startx and the video loaded off my USB stick. Brilliant!!!

Is there a way to turn off/skip all the startup text or is that inevitable?

It's great to see video auto play. The Raspberry Pi is a great piece of kit.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Sun May 26, 2013 5:56 pm

great you got it working!
about silent boot look here: http://www.raspberrypi.org/phpBB3/viewt ... 29&t=17269
did not try it yet.

keep us updated on any progress!

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Mon May 27, 2013 11:07 am

Heya Nolman,
Success last night and went to boot video today and it just loaded the desktop. No errors or anything. I formatted the USB stick, loaded some new videos on and started up the Pi again and still loads the desktop without playing any video or any sign of omxplayer. Very strange! I hadn't even tackled the code to hide the startup text. Time to investigate more....

Thanks,
Adam.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Mon May 27, 2013 11:20 am

are there any spaces in the videofilename? if so delete them

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Mon May 27, 2013 1:15 pm

Wow, very strange. All was working well last night. Videos playing off USB stick. Turned Pi on this morning and no videos playing.

Just re-named videos on USB to one word e.g file.mpg. Still nothing played.

Very strange. Will check all my files and scripts again tomorrow.

Tumerboy
Posts: 41
Joined: Thu May 09, 2013 4:44 am

Re: seamless looping

Tue May 28, 2013 1:02 am

Hey Adza, how did you go about installing the Huceke version? You seem to have figured it out, but I'm not so clever.
This is very much what I'm looking for. Does anyone know a way to have the video start up paused? So it won't play at all until someone presses a button, then it'll play once, loop, and stop again?

Thanks
-Nick

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Tue May 28, 2013 2:21 am

Hi Nick,
I'm at work at the moment, but plan on writing a step by step guide on what I did for my installation. Due to my current error, I was also planning on wiping my card and doing everything from scratch for a "clean" install.

To download the Huceke version, my first step was to type: git clone https://github.com/huceke/omxplayer.git

Cheers!
Adam.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Tue May 28, 2013 10:43 am

Nick, just copy and replace the files on your sd card.

adza
Posts: 9
Joined: Sun May 12, 2013 1:18 pm

Re: seamless looping

Tue May 28, 2013 1:35 pm

I had another play around with the Pi tonight. I turned off auto logon to the GUI and went back to the command prompt and tried running my files on the USB stick. All of my .mpg music video clips that could have been on my hard drive for the past 10 years, didn't work when I played them individually with omxplayer. I kept getting an error.

I formatted my USB stick and then placed two new videos on it. One was an MKV and one was an mp4. The MKV played fine, then the mp4 played all pixelated and blocky. It wasn't recognisable. I took the USB stick back to my computer and deleted the MKV. The mp4 looped continuously.

I then took the USB stick back to my computer and placed four new mp4 files on it. The first movie played fine, but the second mp4 was all blocky, pixelated and unrecognisable. I went back into the command prompt and was able to run each video individually.

The shell script will play a single file in a loop, but when it gets to the next video, everything goes crazy. Is there a reason for this or a solution? I don't need to loop multiple videos, but it would be handy.

Another important question: if I was to have this connected to a store display monitor in my mother's shop, would it eventually damage the SD card if she was turning it off and on via the wall outlet on a daily basis?

Thanks,
Adam.

Tumerboy
Posts: 41
Joined: Thu May 09, 2013 4:44 am

Re: seamless looping

Wed May 29, 2013 3:11 am

Nolman, you say to just overwrite the original files, but where do those omxplayer files live? (I'm new to Linux)

Edit: Scratch that, I 'git'ed the link Adza posted, and followed along with the instructions in the readme, to run a shell script, then 'make ffmpeg' (which took forever)
Now this morning, I was going to finish that process by running "make" but I get a compile error and it quits:

Fatal error: libavcodec/libavcodec.h: No such file or directory
Compilation terminated.

Any advice?

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Wed May 29, 2013 5:29 pm

hi,
i just copied the folder "usr" you find in omxplayer-loop-multifile-bin.tar over the "usr"folder on your raspberry. so just paste and overwrite if asked .

also i regularly do:
sudo apt-get update
sudo apt-get upgrade
sudo rpi-update

to have everything updated.

nolman
Posts: 32
Joined: Sat Mar 30, 2013 9:33 am

Re: seamless looping

Wed May 29, 2013 5:36 pm

@adza

I do not use multiple files when looping.
So i would have to look into that.

you know that mpeg2 files do not work without a license you have to buy?

I only have found overclocking to corrupt the sd card. one of the rpi's i have running here has been booting daily for 1 month now and no problems.
Others have been running for 1 month and also no problems.

Return to “Graphics, sound and multimedia”