Streampunk / beamcoder

Node.js native bindings to FFmpeg.
GNU General Public License v3.0
397 stars 76 forks source link

Creating AVFrame from jpeg images #66

Open rockinggit opened 3 years ago

rockinggit commented 3 years ago

I am trying to create a h264 video from jpeg images using beamcoder. I can read jpeg data using Jimp/jpeg-js but they give data as rgb data. how to assign this data to AVFrame (which takes yuv data). for this purpose i can use ffmpeg swcontext also to convert data. but i can't find out a way to get swsContext from beamcoder.

joamag commented 2 years ago

I'm also curious about how can this JPEG to AVFrame can be achieved in the most efficient way possible. Any ideas @scriptorian ?

Bahlinc-Dev commented 2 years ago

Process would be: jpeg_image (compressed) -> mjpeg decoder (uncompressed) -> FORMAT FILTER (uncompressed) -> video encoder (compressed again). You can use format=pix_fmts=yuv420p to do this.