How to get Video Playback in xLights

BradsXmasLights

WiFi Interactive
Joined
Dec 23, 2010
Messages
601
Location
Brisbane, Australia
For those wanting to get video playing back on their new P10 matrix's, this is the trick to making it happen with xLights.

You basically are converting the video to a zillon images and the "Picture" effect will magically slideshow them based on your sequence's timing, on the proviso that the picture effect filename contains a dash like something-1.png

eg:
50ms sequence = 20 frames/images needed per second (little slower than normal PAL video @ 25fps)
25ms sequence = 40 frames a second

So do convert your video to a zillon images, use ffmpeg.exe which is in the xLights directory.

Open a command prompt window, and you'll want to run a command something like what is below:

Code:
cd C:\Program Files (x86)\xLights


Code:
ffmpeg -i c:\temp\lego\LegoSmall.mp4 -s 160x80 -r 40 c:\temp\lego\lego-%d.png

where...
  • c:\temp\lego\ is the folder where my video & images will be located
  • LegoSmall.mp4 is my source video
  • lego-%d.png is my output filename. %d will be replaced for the frame number.
  • -s 160x80 is to resize the video to fit 160 x 80 pixels.
  • -r 40 is resample frame-rate to 40fps (25ms)
The once you have all your images, select the first image in the picture effect and enjoy :)
 
  • Like
Reactions: roy

Jimbo

Full time elf
Joined
Feb 27, 2014
Messages
144
Hi,

Thanks for this, although I can't get it to work, ie when I click on the icon for ffmeg in the directory the cmd screen comes up and disappears straight away.

Any reason it is doing this?
 

AAH

I love blinky lights :)
Community project designer
Joined
Dec 27, 2010
Messages
4,188
Location
Eaglehawk
The program is a command line thingy. You actually need to drop back to the good old dos style window by running cmd and then entering the string as Brad showed.
 

Jimbo

Full time elf
Joined
Feb 27, 2014
Messages
144
Yeah.

I tried that to and get 'C:\' is not recognised as an internal or external command, operable program or batch file.
 

Jimbo

Full time elf
Joined
Feb 27, 2014
Messages
144
Ahh ok,

But I still can't get anything to come up.

What part is the actual command I type into the cmd prompt?
 

Superman

I Have C.L.A.P and its very infectious
Global moderator
Joined
May 29, 2010
Messages
1,778
Location
Ipswich-QLD
check back in a day or so Jimbo. I'm working on a video tutorial mate
 

AAH

I love blinky lights :)
Community project designer
Joined
Dec 27, 2010
Messages
4,188
Location
Eaglehawk
The location of xlights will vary depending on the version of windows (32bit, 64bit, win xp, win 7 etc)
Get to the command prompt by going to Start/Run and then typing CMD followed by enter
The next bit will depend on the version of windows you use but if you can find the xlights directory with windows explorer you should be able to work out what type

cd C:\Program Files (x86)\xLights
or

cd C:\Program Files\xLights

then you would enter the command line stuff as per
ffmpeg -i c:\temp\lego\LegoSmall.mp4 -s 160x80 -r 40 c:\temp\lego\lego-%d.png
 

Gilrock

Full time elf
Joined
Jan 4, 2013
Messages
438
Location
Tucson, AZ
The best thing to do is just add your xlights installation directory to your Path. At least that's what I'm assuming I must have done because I never go to the xlights directory. I like to work in the folder where my video resides and I never type any pathnames.
 

smeighan

Dedicated elf
Joined
Jan 19, 2012
Messages
1,109
Location
4217 Greenfinch Dr CO 80126
I am suppose to add the installation path to $PATH during install. U should be able to see ffmpeg from any directory. Ffmpeg.exe has been part of the installation since apr,2013
 

Gilrock

Full time elf
Joined
Jan 4, 2013
Messages
438
Location
Tucson, AZ
Ok so I probably didn't alter my path...Sean did it for me. :)

Anyways I've been just starting to use this quite a bit testing my new P10 panel so now I can see a benefit to allowing the user to enter custom frame rate when creating sequences. The only thing I'm not sure about it whether there are any limitations on playback using the Pi or BBB. Do they support any playback rate?
 

Greg.Ca

Apprentice elf
Joined
Jan 1, 2013
Messages
92
The difficult part for me is 'stripping' out 30 seconds or so out of a 2 hour DVD. How is it possible to remove just 30 second or so out of a full 2 hour DVD movie? Example, in the old Christmas Vacation movie, I think it would be great to just show Chevy Chase finally and successfully plugging in his Christmas lights and them at the perfect moment, I would turn on all of my lights as if Chevy Chase actually turned on 'MY' lights.

So I need to strip out just 30 seconds or so when Chevy Chase plugs in his lights. Not sure how to do that. --Greg--
 
Top