Node-OpenMAX icon indicating copy to clipboard operation
Node-OpenMAX copied to clipboard

Displaying JPEG images to screen

Open digi-chris opened this issue 7 years ago • 0 comments

Hi,

I'm trying to get JPEG images to display to screen, but my code just seems to hang somewhere after the image decode is initiated and nothing appears on screen. Should the following work?

"use strict";
var fs = require('fs');
var omx = require('openmax');
var ImageDecode = new omx.ImageDecode();
var VideoRender = new omx.VideoRender();
omx.Component.initAll([ImageDecode, VideoRender])
        .then(function () {
          ImageDecode.setInputFormat(omx.IMAGE_CODINGTYPE.IMAGE_CodingJPEG);
      
          fs.createReadStream("frame_01.jpg")
                  .pipe(ImageDecode)
                  .tunnel(VideoRender)
                  .on('finish', function () {
                    console.log("Done");
                    process.exit();
                  });
        });

Thanks,

Chris.

digi-chris avatar Mar 07 '18 10:03 digi-chris