1

I was wondering how compatible Node.js is with videos. Not playing them, but actually editing it. My end goal is to reverse videos online. Java looks like my best bet so far, but I do like how Node.js is fast, scalable, etc.

Does anyone know if it is possible with node.js? At lease being able to break up videos into frames, putting them into an array of some sort, and then sticking them back up.

My guess is probably not, as it looks as it is based off of JavaScript. I may be wrong, but I think javaScript is more UI, Animating, Simple Data jobs, etc. Not big time video editing.

Any help is highly appreciated.

Makoto
  • 104,088
  • 27
  • 192
  • 230
Alex
  • 145
  • 1
  • 4
  • 15

2 Answers2

7

ffmpeg/libav is the go-to library for this sort of thing on Linux. While there are some ffmpeg bindings for node.js (e.g, https://github.com/xonecas/ffmpeg-node), they aren't quite as complete as you'd need for this task, and in any case ffmpeg is itself not asynchronous in the sort of way that you'd need to make this make sense for node.js.

I'd start by trying to implement this task using ffmpeg/libav using C, then consider other implementations afterwards.

  • C is for more native applications right? Or is it possible to run C online. I am hoping this will become a web app, nothing to download for the user. – Alex Aug 20 '12 at 14:05
  • 1
    It's perfectly possible to run C code "online", or to call it from a web application of some variety. –  Aug 20 '12 at 14:55
  • You'd run the ffmpeg process as a child process from Node.js, so it would be async by nature. – Alexander Mills Aug 24 '18 at 05:10
4

I would approach this from the other end: What tool can I use to reverse videos? I'm sure there are better options out there, but at least it's possible to do with ffmpeg, according to this SO answer. The caveat is that you have to split it into images and then stitch them back together.

If you would go with this route (i.e., using ffmpeg in the manner described), you could indeed accomplish it with node.js for the web application and job handling. I would have some kind of workers (either something similar to e.g. resque or using e.g. node.js child_process.fork).

As @duskwuff mentions in his answer, this solution won't be streaming, but using workers, you might be able to accomplish something acceptable, depending on your requirements.

If, on the other hand, you have e.g. a Java library that's awesome in reversing videos, you should use that, and perhaps build the web app in Java as well.

Community
  • 1
  • 1
Linus Thiel
  • 38,647
  • 9
  • 109
  • 104
  • The only lead I have on Java is vid2java: http://www.exactfutures.com/index02.htm The only problem is I have no idea where to start with Java, as I have no experience in it. I am more comfortable with a Node.js type thing. – Alex Aug 20 '12 at 13:55