Page 1 of 3

LoveVideo - LÖVE module for playing video

Posted: Sun Sep 28, 2014 6:21 am
by josefnpat
LoveVideo

Taking a lot of inspiration from this thread, I refactored and documented the mjpeg library into a module.

There is also a handy dandy bash script that takes most of the hassle out of making the target videos.

Image

GITHUB: https://github.com/josefnpat/LoveVideo
DOCS: http://50.116.63.25/public/lovevideo/doc/
SAMPLES: http://50.116.63.25/public/lovevideo/samples/
DEMO: http://50.116.63.25/public/lovevideo/Lo ... -demo.love

DEMO
  • Big Buck Bunny Tailer (360x200 @ 92% JPG Quality)
  • Sintel Trailer (214x120 @ 92% JPG Quality)
  • Starfire Lords: Genesis Intro (640x360 @ 92% JPG Quality)
Download Here [24MB]

Much löve to all you devs who made this possible.

Please direct bugs, patches and feature requests here: https://github.com/josefnpat/LoveVideo/issues

Features:
  • Supports PNG/JPG and now DDS!
  • Full OOP
  • Love like API for easy implementation;

    Code: Select all

    LoveVideo = require "LoveVideo.lovevideo"
    
    bunny = LoveVideo.newVideo("big_buck_bunny")
    
    function love.draw()
      bunny:draw(0,0,
        love.graphics.getWidth()/bunny:getWidth(), -- x scale
        love.graphics.getHeight()/bunny:getHeight() -- y scale
      )
    end
    
    function love.update(dt)
      bunny:update(dt)
    end
  • Inline LDOC documentation for easy usage and generation.
  • Convert tool for generating the target video (love-video) from any video type supported by avconv
  • Sample Generation tool for generating a sample with the previously mentioned convert tool.
  • Back-end threading to attain awesome framerate performance (like love-mjpeg!)
  • Aggressive caching to reduce overhead by about 100%.

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Sep 29, 2014 5:37 am
by jjmafiae
any new formats or new features?

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Sep 29, 2014 1:07 pm
by markgo
Amazing :o

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Sep 29, 2014 5:53 pm
by Cryogenical
What file formats does this support?

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Sep 29, 2014 6:35 pm
by josefnpat
Cryogenical wrote:What file formats does this support?
TL;DR; everything, but in all reality, it's fake.

LoveVideo can support any video that `avconv`, `ffmpeg` or any other frame grabber can extract from a video. The file "format" is a directory containing;
  • jpg/png images (%d.[jpg|png]),
  • audio data (audio.ogg) and
  • metadata containing playback information (info.lua).
You can see examples here: http://50.116.63.25/public/lovevideo/samples/

In all technicality, mjpeg did not support mjpeg's. It does the same thing as this library does.

I imagine one could introduce something like luaplayer, but then you have a solution that isn't pure lua, and you get shafted when you want portability.

There is mjpeg-player-for-LOVE-engine ... might be able to incorporate some of that in, but from personal experience there are some bugs with this for android.

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Oct 06, 2014 10:40 am
by SiENcE
Nice.

What about using dds (dxt)?

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Oct 06, 2014 1:42 pm
by josefnpat
SiENcE wrote:Nice.

What about using dds (dxt)?
Assuming that imagemagick can handle the conversion (or you have the frames in that format already)

you should be able to; I don't see why it shouldn't work then!

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Oct 06, 2014 2:06 pm
by SiENcE
I thought, maybe dss/dxt offers better compression.

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Oct 06, 2014 3:29 pm
by josefnpat
SiENcE wrote:I thought, maybe dss/dxt offers better compression.
10:40 <bertbas> josefnpat: it also loads faster, btw
10:40 <bertbas> which may be interesting for your purposes
I've got a patch right now that makes it happen, but I'm getting segfaults (as is bartbes), so I won't push it into the mainline yet;

I'm doing something along these lines to repro;

Code: Select all

git clone git@github.com:josefnpat/LoveVideo.git && cd LoveVideo
wget http://pastebin.com/raw.php?i=YBfMFhMT -O dds.patch
patch -p1 < dds.patch
./tools/gen_sample.sh
love .

Re: LoveVideo - LÖVE module for playing video

Posted: Mon Oct 06, 2014 6:28 pm
by josefnpat
Ok, hate to double-post so soon, but I have added DDS/RX1 compression!

https://github.com/josefnpat/LoveVideo/ ... 4ae8f260bf

Quite a fantastic performance increase!