samirkumardas / jmuxer

jMuxer - a simple javascript mp4 muxer that works in both browser and node environment.
Other
549 stars 108 forks source link

Extract individual frames as images from h264 stream #53

Closed impronunciable closed 3 years ago

impronunciable commented 3 years ago

Hi, first of all thank you for creating this amazing lib!

I have a usecase where I need to feed an h264 stream and get individual frames back as images. Is it possible to do it with jmuxer? do you know otherwise a way that I can play with the lib to get the needed information?

(I was already able to feed the stream into a video tag)

Thank you.

samirkumardas commented 3 years ago

Thank you. You did not mention the environment. I am assuming the browser environment. It is not possible to grab images using jMuxer as the rendering is done by the browser engine. However,

  1. You can extract images from video tags using canvas API. You will get several examples in StackOverflow.
  2. You can check broadway H.264 decoder https://github.com/mbebenita/Broadway and make the images from the decoded frame using canvas or webGL. You will find the example there.
impronunciable commented 3 years ago

Thank you!