1. New to Christmas lighting? Get started with the AusChristmasLighting 101 Manual:
    auschristmaslighting.com/wiki/AusChristmasLighting-101

How to get Video Playback in xLights

Discussion in 'xLights (Nutcracker)' started by BradsXmasLights, Aug 12, 2015.

  1. BradsXmasLights

    BradsXmasLights WiFi Interactive

    Joined:
    Dec 23, 2010
    Messages:
    502
    Likes Received:
    9
    Location:
    Brisbane, Australia
    Find Me On:
    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...
    • [SIZE=small]c:\temp\lego\ is the folder where my video & images will be located[/SIZE]
    • [SIZE=small]LegoSmall.mp4 is my source video[/SIZE]
    • [SIZE=small]lego-%d.png is my output filename. %d will be replaced for the frame number.[/SIZE]
    • [SIZE=small]-s 160x80 is to resize the video to fit 160 x 80 pixels.[/SIZE]
    • [SIZE=small]-r 40 is resample frame-rate to 40fps (25ms)[/SIZE]
    The once you have all your images, select the first image in the picture effect and enjoy :)
     
  2. Superman

    Superman I Have C.L.A.P and its very infectious Global Moderator

    Joined:
    May 29, 2010
    Messages:
    1,627
    Likes Received:
    15
    Location:
    Ipswich-QLD
    Find Me On:
  3. Jimbo

    Jimbo Full Time Elf

    Joined:
    Feb 27, 2014
    Messages:
    119
    Likes Received:
    0
    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?
     
  4. AAH

    AAH I love blinky lights :) Community Project Designer

    Joined:
    Dec 27, 2010
    Messages:
    2,543
    Likes Received:
    14
    Location:
    Eaglehawk
    Find Me On:
    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.
     
  5. Jimbo

    Jimbo Full Time Elf

    Joined:
    Feb 27, 2014
    Messages:
    119
    Likes Received:
    0
    Yeah.

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

    BradsXmasLights WiFi Interactive

    Joined:
    Dec 23, 2010
    Messages:
    502
    Likes Received:
    9
    Location:
    Brisbane, Australia
    Find Me On:
    C:\> is the DOS prompt example, not the command :)
     
  7. Jimbo

    Jimbo Full Time Elf

    Joined:
    Feb 27, 2014
    Messages:
    119
    Likes Received:
    0
    Ahh ok,

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

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

    Superman I Have C.L.A.P and its very infectious Global Moderator

    Joined:
    May 29, 2010
    Messages:
    1,627
    Likes Received:
    15
    Location:
    Ipswich-QLD
    Find Me On:
    check back in a day or so Jimbo. I'm working on a video tutorial mate
     
  9. AAH

    AAH I love blinky lights :) Community Project Designer

    Joined:
    Dec 27, 2010
    Messages:
    2,543
    Likes Received:
    14
    Location:
    Eaglehawk
    Find Me On:
    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
     
  10. Gilrock

    Gilrock Full Time Elf

    Joined:
    Jan 4, 2013
    Messages:
    389
    Likes Received:
    6
    Location:
    Tucson, AZ
    Find Me On:
    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.
     
  11. smeighan

    smeighan Dedicated Elf

    Joined:
    Jan 19, 2012
    Messages:
    1,064
    Likes Received:
    9
    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
     
  12. Gilrock

    Gilrock Full Time Elf

    Joined:
    Jan 4, 2013
    Messages:
    389
    Likes Received:
    6
    Location:
    Tucson, AZ
    Find Me On:
    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?
     
  13. Greg.Ca

    Greg.Ca Apprentice Elf

    Joined:
    Jan 1, 2013
    Messages:
    92
    Likes Received:
    0
    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--
     
  14. ShellNZ

    ShellNZ Senior Elf

    Joined:
    Jun 17, 2012
    Messages:
    848
    Likes Received:
    1
    Location:
    Karaka, Auckland, NZ
    Find Me On:
    Download AVI Demux.

    Open the movie.

    Set a start marker and end marker then save :)
     
  15. Greg.Ca

    Greg.Ca Apprentice Elf

    Joined:
    Jan 1, 2013
    Messages:
    92
    Likes Received:
    0

Share This Page