Any way (at all) to play .avi movies?


#1

Maddening gap in an app I’m developing is there appears to be little (or no) support for AVI in the HTML5 video implementation. So, I need a workaround that is cross-platform, and package-able with my electron app.

  • Videos are hosted locally
  • I’m not averse to encoding on the fly (ffmpeg avi - mp4 and use HTML5 natively?)
  • WebChimera is dead due to VLC and Electron changes (devs can’t keep up) (https://github.com/RSATom/WebChimera.js/issues/69)
  • Is there another npm package that can do this?
  • A VLC wrapper might work – but how do I ensure that VLC is available on the system?
  • Should I just spawn a native app in a separate window (ie, Totem on Linux)? (seems clunky)

NB: Files are decidedly AVI. I can’t change this.

Any hints / pointers greatly appreciated!


#2

You could try videojs with the videojs-java plugin… I haven’t specifically tried playing avi videos using this plugin but videojs is widely used so I suspect this might solve your problem.


#3

Thanks for the lead, but it seems to be broken with the latest java.js… (https://github.com/Afterster/videojs-java/issues/2) and somehow adding another layer (java) to the electron stack seems somehow unsavory.


#4

FFBinaries (https://github.com/vot/ffbinaries-node) seems promising… but oddly FFPlay is not available for Linux (though I suspect my linux consumers likely have a ffmpeg already installed).


#5

Hi,

First of all - happy to see people finding ffbinaries on their own, I created it a while back but still didn’t even get to use it in my projects. I actively maintain it so if you have any problems with it please flag them up on GitHub :slight_smile:

Basically the deal with missing ffplay on Linux and ffserver on Windows is that I only repackaged existing binaries compiled by other people. The reason for that was that I wanted a consistent archives, split into individual components (as most people will really need just one).
I didn’t have time to build all of it on all different platforms but that work was fortunately already done (see Credits section here: http://ffbinaries.com/readme)

I also intend to use ffplay so I will need to find a way of shipping that as well (perhaps I’ll just grab a binary from my own Linux box).
You may want to do transcoding avi -> mp4 but that generates CPU usage levels comparable to a video playing in a YouTube tab in Chrome. ffplay is definitely more efficient at it so that’s what I’d suggest sticking to - I will try to sort that out shortly.


#6

Just as an update I added ffplay for linux-32 and linux-64 platforms. The binaries feel a bit light so they may not be covering the exact same set of codecs.
They are the binaries that are shipped through apt-get install ffmpeg on Ubuntu-based distros so I presume they have a reasonable coverage but the long answer will be to build it all manually in a consistent manner.