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

Re: seamless looping

Thu May 30, 2013 3:43 am

I must have the wrong thing then. . . I followed Adza's advice:
git clone https://github.com/huceke/omxplayer.git

and what I have is a directory called 'omxplayer' full of all sorts of files and directories, but none are 'usr'

. . . did I just download the wrong thing? Or am I missing something here?

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

Re: seamless looping

Thu May 30, 2013 6:15 am

Ok, I found the tar.gz somewhere and have the -L working.
How do I tell it to go through multiple files?

Thanks for the help all!

Anyone have any idea how to pause it at the start of each play?

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

Re: seamless looping

Thu May 30, 2013 7:03 am

tumerboy,
Can you give an example of how you would want it to work with pausing and multiple files?
I choose this manner of looping because it is the closest to "seamless" looping with the smallest gap.
Maybe there is an easier way tot do what you want, but i'm not sure what you are trying to do...

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

Re: seamless looping

Thu May 30, 2013 11:41 am

I decided to get a little bit tricky tonight and created a new shell script based on the following code:

http://www.cenolan.com/2013/03/looping- ... pberry-pi/

I then put the script in init.d and now my Pi loops video automatically on startup and I can have various videos on the USB stick.

My problem: I can't get back into the text prompt because omxplayer is continuously looping. Pressing 'q' just starts a new video.

Is there a way of getting out of a continuous loop?

Thanks,
Adam.

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

Re: seamless looping

Thu May 30, 2013 1:31 pm

Nolman, I'm trying to make a video kiosk, for a small museum I work for. The idea is that we'd sprinkle these kiosks throughout the collection. As a tour guide lead a tour through the collection, they'd come upon a kiosk, which would be paused at the start of the video. The guide would press a button hooked up to the GPIO, to unpause the video (this part is working already), the video would play through once, loop back to the start, and pause again, waiting for the next interaction.

I don't really have plans to show multiple videos on one kiosk, but I saw that the git file said "multifile" and wondered how that worked. I like Adza's shell script method to loop through multiple videos as well. There are already going to be 3 buttons on the kiosk already, used for photo slide show versions, where you can pause the slideshow, or go to the next/previous image. The slideshow is already working wonderfully. So, with the video version of the kiosk, it would be cool if I could put in multiple video files, and have those next/previous buttons do essentially the same thing, and swap to the next/previous video, but again, start each one paused, requiring someone to hit the play button. It would again, play through the selected video once, then pause at the start of the next. Or something.

Multifile at this point would be nice, but the pausing on a single video loop is more important.

Thanks again for all the help though.

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

Re: seamless looping

Thu May 30, 2013 3:06 pm

Tumerboy,
i'm a linux noob,
But i don't really see the need for looping in your setup.
wouldn't it be easier to do it without?
can't the previous and next button cycle trough a playlist en then the play button starts the videofile?
If you need to see the start of the video paused, you can maybe show a screenshot?

some script with:
previous and next scroll trough the number of files.
ex

set the number of files = 5
next = +1
previous = -1
playfile="current selected file"
play = omxplayer $playfile

you can then set the screenshot that when "file1" is selected it shows screenshot1

can you tell me how you pause the video at the beginning ?

also have a look at http://pipresents.wordpress.com/

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

Re: seamless looping

Thu May 30, 2013 3:12 pm

adza,
I found a way to exit omxplayer trough a keyboard shortcut.
i made one that triggers the following script:

#!/bin/sh
# echo "trying to stop loop"
sudo kill $(ps aux | grep '[o]mxplayer' | awk '{print $2}')
sudo kill $(ps aux | grep '[o]mxplayer.bin' | awk '{print $2}')
sudo kill $(ps aux | grep '[v]ideoloop.sh' | awk '{print $2}')
sudo xrefresh -display :0

make a kill command with your script that is running to stop it

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

Re: seamless looping

Thu May 30, 2013 3:26 pm

Uh, I guess it technically doesn't have to loop, but if it doesn't, then when the video is done playing, it just dumps me back to the desktop with a terminal window. Not something I really want to show off in the museum.

I'm not sure how I'd have it display an image between videos, and have it all seamless.

The nice thing with the -L loop, is that it is seamless, so even if there's a hitch, you never see the desktop. If it could just pause at the start of the video, that would do everything I want it to.

I can't tell you how to pause at the start of the video, because that is exactly what I'm trying to figure out. If it just paused at the beginning of every video, I think I'd have it.


Edit: And no, I hadn't seen Pi Presents before. . . I'll definitely investigate that. Thanks!

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

Re: seamless looping

Fri May 31, 2013 3:44 pm

Just as an update, PiPresents seems to be exactly what I needed! Thank you very much Nolman!

impatelss789
Posts: 3
Joined: Wed Jun 05, 2013 9:24 am

Re: seamless looping

Wed Jun 05, 2013 9:44 am

hi guys,
i have installed Debian Wheezy on my SDcard, but the following shell script of seamless video loop for omxplayer doesn't seem to be working on Debian wheezy.........
http://www.cenolan.com/2013/03/looping- ... pberry-pi/

whenever i run this script using ssh it prints following on the terminal
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help'

does anyone know why this is happening?

impatelss789
Posts: 3
Joined: Wed Jun 05, 2013 9:24 am

Re: seamless looping

Wed Jun 05, 2013 10:11 am

@adza
i tried one shell script for looping videos using omxplayer. The script can be viewed here http://www.cenolan.com/2013/03/looping- ... pberry-pi/
but i think this script is for Raspbian wheezy and i have Debian wheezy. It is not working, it shows the following error continuously until we press ctrl+c
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help'

impatelss789
Posts: 3
Joined: Wed Jun 05, 2013 9:24 am

Re: seamless looping

Wed Jun 12, 2013 11:20 am

sorry .........
it was creating problem because videos were not in MP4 format.........

guruevi
Posts: 7
Joined: Fri Aug 09, 2013 2:53 pm

Re: seamless looping

Sun Aug 25, 2013 3:26 am

Hi there,

I built an electronic ad/menu system using an RPi. There is no sound/audio though as it isn't a requirement for my clients.

-automatic turn on at boot (solved)
-seamless loop of one video (solved)
-seamless connection from one video to another in a playlist, and looping of the playlist (solved)
-options for controlling fade in and out if desired (not done but could probably be done fairly easily)
-ability to easily put videos onto the card via the internet (solved)
-ability to loop with audio included (not done, don't know if that's easy though - I could probably synchronize audio similar to how video is done)
-ability to handle a wide range of video codecs (solved)
-ability to interrupt the video to get back to the GUI or prompt (why?)
-maybe the ability to do a slide show feature, and even use pdf and powerpoint files that way (PDF works, PowerPoint is a pain because it's not a standard file format thus it cannot be represented correctly using open source software)

MrOaiki
Posts: 33
Joined: Fri Jun 28, 2013 12:21 am

Re: seamless looping

Sat Sep 07, 2013 3:46 pm

guruevi wrote:Hi there,

I built an electronic ad/menu system using an RPi. There is no sound/audio though as it isn't a requirement for my clients.

-automatic turn on at boot (solved)
-seamless loop of one video (solved)
-seamless connection from one video to another in a playlist, and looping of the playlist (solved)
-options for controlling fade in and out if desired (not done but could probably be done fairly easily)
-ability to easily put videos onto the card via the internet (solved)
-ability to loop with audio included (not done, don't know if that's easy though - I could probably synchronize audio similar to how video is done)
-ability to handle a wide range of video codecs (solved)
-ability to interrupt the video to get back to the GUI or prompt (why?)
-maybe the ability to do a slide show feature, and even use pdf and powerpoint files that way (PDF works, PowerPoint is a pain because it's not a standard file format thus it cannot be represented correctly using open source software)
How did you make the loops seamlsess?

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

Re: seamless looping

Tue Jan 21, 2014 8:36 pm

nolman wrote:adza,
I found a way to exit omxplayer trough a keyboard shortcut.
i made one that triggers the following script:

#!/bin/sh
# echo "trying to stop loop"
sudo kill $(ps aux | grep '[o]mxplayer' | awk '{print $2}')
sudo kill $(ps aux | grep '[o]mxplayer.bin' | awk '{print $2}')
sudo kill $(ps aux | grep '[v]ideoloop.sh' | awk '{print $2}')
sudo xrefresh -display :0

make a kill command with your script that is running to stop it
im a bit confused how this works... can you give more detailed instructions?

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

Re: seamless looping

Wed Jan 22, 2014 12:13 pm

in

sudo kill $(ps aux | grep '[v]ideoloop.sh' | awk '{print 1.48€}')

you replace "[v]ideoloop.sh" with the name of your script that is running.
like "[y]ourscript.sh"
it wil kill the proces.

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

Re: seamless looping

Thu Jan 23, 2014 6:57 am

ok and where do you put that?

and is that any key? you have two different codes for the

Code: Select all

sudo kill $(ps aux | grep '[v]ideoloop.sh' | awk '{print 1.48€}') 

Code: Select all

sudo kill $(ps aux | grep '[v]ideoloop.sh' | awk '{print $2}')
should this be a bash file that calls the video loop as well as stop it? im a bit new but getting it lil by little! so thanks

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

Re: seamless looping

Thu Jan 23, 2014 8:17 am

assign a shortcut (mine= ctrl+f10) to run something like "bash /home/stoploop.sh"

create the script "stoploop.sh" in your homedirectory (or anywhere i think)
and insert the kill codes+....

Now when you press ctrl+f10 any kill line will stop that process and "refresh...." will refresh te screen.

i'm not really good at this :-) but i got it to work a while ago, i will have to search for the exact way to do it.

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

Re: seamless looping

Mon Jan 27, 2014 7:41 pm

nolman wrote:assign a shortcut (mine= ctrl+f10) to run something like "bash /home/stoploop.sh"

Now when you press ctrl+f10 any kill line will stop that process and "refresh...." will refresh te screen.
.
i do not understand in the code where you set the
(mine= ctrl+f10)


also how do i add any code int my omxplayer.sh to get thsi working or just add the stop.sh in same director?

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

Re: seamless looping

Mon Jan 27, 2014 8:58 pm

that code is just in a linux general os keyboard shortcut assignment.
i thing i used xbindkeys software.

take a look at a configuration example here (like the default):

http://www.nongnu.org/xbindkeys/xbindke ... figuration

http://www.nongnu.org/xbindkeys/xbindkeysrc_d


i probably did something like:

# start the stoploop script
"bash /home/pi/stoploop.sh"
control + f10

dynamitemedia
Posts: 30
Joined: Sun Dec 01, 2013 9:12 pm

Re: seamless looping

Tue Jan 28, 2014 1:05 am

just cant wrap my head around it...

i have tried and it just keeps staying on that black screen even with using the xrefresh -display :0

could you show me the full way your doing it i must be missing something somewhere cause it does kill omxplayer but then will sit at a black screen and it shouldnt it is like the xrefresh is not being called

peterjosvai
Posts: 2
Joined: Tue Feb 04, 2014 1:58 pm

Re: seamless looping

Tue Feb 04, 2014 2:07 pm

thanks a lot for this decisive contribution, Denjell !! :)

SparkyPinball
Posts: 1
Joined: Tue Mar 04, 2014 4:51 pm

Re: seamless looping

Tue Mar 04, 2014 5:08 pm

I would like to start one video file on power-up and repeat (seamless and sound isn't necessary), but I'd like to do it on a 4" - 5" display (100mm). Anyone have a suggestion for a display that size connected to the RPi? If it comes with a bezel, even better.

I am currently using two different display modules from 4D Systems to do this very thing, and I've been successful with a 128mm x 128mm display, however the wmv file plays at half speed. I fixed that by manipulating the original file to play 2x before I convert it to the micro sd card for the 4D Systems display, but the frames per second capabilities of these displays are very limited. My video file plays good enough for my needs.

The second display is over 100mm and I have it programmed to do the same thing as the smaller one, but the fps capabilities for this display is only around 5fps. I can play the video file and repeat no problem, but the refresh rate is horrible and causes the video to appear jumpy, choppy, and as if it's scrolling through frames.

So...I'm assuming a display module just doesn't have the power to do it. I'm wondering if a RPi connected to a display that is capable of showing 30fps is out there at an affordable price.

ohthedave
Posts: 5
Joined: Thu Mar 27, 2014 3:14 pm

Re: seamless looping

Thu Mar 27, 2014 3:19 pm

Hi all. I was trying to do the same thing, but couldn't get it going on the current version of Raspbian. I finally did figure it out through some digging, so I pulled all the helpful info together from this thread and other places and posted a how-to guide here: http://curioustechnologist.com/post/808 ... ideo-kiosk

Hope this helps anyone else looking for a solution like this! Thanks to everyone who chipped in a piece of the puzzle. FYI: this plays a perfectly seamless, endless video (no audio) loop, identical to what colby and his son cooked up, that works on the current (Wheezy) build of Raspbian.

-Dave

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

Re: seamless looping

Thu Mar 27, 2014 10:59 pm

thanks a lot ohthedave!!!!

Return to “Graphics, sound and multimedia”