LoveVideo - LÖVE module for playing video

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

LoveVideo - LÖVE module for playing video

Post 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%.
Last edited by josefnpat on Wed Oct 08, 2014 1:04 pm, edited 5 times in total.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: LoveVideo - LÖVE module for playing video

Post by jjmafiae »

any new formats or new features?
User avatar
markgo
Party member
Posts: 189
Joined: Sat Jan 05, 2013 12:21 am
Location: USA

Re: LoveVideo - LÖVE module for playing video

Post by markgo »

Amazing :o
User avatar
Cryogenical
Prole
Posts: 49
Joined: Mon Apr 28, 2014 5:23 pm

Re: LoveVideo - LÖVE module for playing video

Post by Cryogenical »

What file formats does this support?
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: LoveVideo - LÖVE module for playing video

Post 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.
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: LoveVideo - LÖVE module for playing video

Post by SiENcE »

Nice.

What about using dds (dxt)?
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: LoveVideo - LÖVE module for playing video

Post 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!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: LoveVideo - LÖVE module for playing video

Post by SiENcE »

I thought, maybe dss/dxt offers better compression.
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: LoveVideo - LÖVE module for playing video

Post 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 .
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: LoveVideo - LÖVE module for playing video

Post 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!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 47 guests