1

I want to extract images from MP4 as MJPEG Format. MJPEG consists of delimiters for start and end of the JPEG, is there any way like this to extract images from MP4 with Javascript?

As alternative way for this, MP4 can be rendered into a canvas and the canvas is captured frame by frame using Javascript. However, this method is slow and performance changes depending on the system specifications.

Community
  • 1
  • 1
Berkay Yildiz
  • 595
  • 7
  • 23
  • 1
    Just to verify...you mean to say "with the assumption that the MP4 is in MJPEG format", right? If this is possible, you should be aware that MP4s are usually not in MJPEG format, but a much more complex one. – Katana314 Aug 26 '15 at 20:21
  • There is a node.js API for ffmpeg https://github.com/fluent-ffmpeg/node-fluent-ffmpeg – Daniel Lizik Aug 26 '15 at 20:25
  • @Katana314 I know, both are different each other and MP4 is more complex. However, I am asking that is there any way like [this method](http://stackoverflow.com/questions/4801933/how-to-parse-mjpeg-http-stream-within-c/4802265#4802265) to extract image from MP4 frame by frame. – Berkay Yildiz Aug 26 '15 at 20:32
  • @Daniel_L it looks like awesome, but I need a solution which is running in browser. – Berkay Yildiz Aug 26 '15 at 20:33
  • 2
    @Berkay My point being, it sounds like a method like the one you linked could potentially work, maybe a bit slowly; but *only* if the MP4 in question is in MJPEG format originally. If you look in a tool like Handbrake, many options for MP4 codecs exist; the most common is AVC, which is worlds more difficult to parse than MJPEG would be. Remember: MP4 is the container, the codec (the important part) of the file could be something like MJPEG or AVC or something else. – Katana314 Aug 26 '15 at 21:14

0 Answers0