Play local .avi videos in Node.js / Electron app.

The downside to the application I'm developing seems to be little (or no) AVI support in the HTML5 video implementation. So, I need a workaround that is cross platform and capable of bundling with my e-app.

  • Videos are hosted locally.
  • I don't mind coding on the fly (ffmpeg avi β†’ mp4 and use HTML5 natively?)
  • WebChimera seems to be dying due to VLC and Electron changes (developers can't keep up) (Is there another npm package that can do this?)
  • A wrapper that calls a native VLC instance might work, but how can I ensure that VLC is available on the system with my packaging?
  • Should I just create my own application in a separate window (i.e. Totem on Linux)? (seems awkward)
  • The latest videoj-java plugin seems to have a problem ( https://github.com/Afterster/videojs-java/issues/2 ) and adding another layer (java) to the electronic stack seems somehow dubious.
  • FFBinaries ( https://github.com/vot/ffbinaries-node ) seems promising ... but strangely FFPlay is not available for Linux (although I suspect my Linux clients probably already have ffmpeg installed).

NB: The files are clearly AVI. I cannot change this.

Any hints / pointers are greatly appreciated!

UPDATE

On my system using ffmpeg to convert:

ffmpeg -i infile.AVI -vcodec copy -acodec copy outfile.mp4

      

Not enough time (short videos):

real    0m0.138s
user    0m0.100s
sys     0m0.032s

      

So, I tend to pack ffmpeg with my program and convert before uploading.

+3


source to share


1 answer


Take a look at this project:

According to the known supported formats:

it supports:

  • mp4
  • WebM
  • OGG
  • mov (MPEG4 | H.264)
  • avi (MPEG4 | H.264)
  • mkv (MPEG4 | H.264)
  • m4v (MPEG4 | H.264)


Take a look at its source code and see if you can implement it similarly.

You said you need AVI support, but AVI is just a container - if you need other codecs than those supported by this project, then you still have to recode it first.

If you can't do it like this, try using something similar to:

and the mplayer package with your app or another player.

+1


source







All Articles