1

I am trying to encode raw frames with nanoPi 2 fire board computer. I have founded api for it: https://github.com/friendlyarm/nexell_linux_platform

Accroding to nx_video_api.h I need to open device, init it, alocate memory for input and output frame, and then push encoding with "NX_VidEncJpegRunFrame".

However that is the problem, can anyone help me with alocating memory for this structure "NX_VID_ENC_IN"? How to put raw frame there? What pixel format it should be? How to read data back from "NX_VID_ENC_OUT"?

I cannot find any sample or tutorial for hw encoding on that chip, so any example would be greatly appriciated.

mpromonet
  • 11,326
  • 43
  • 62
  • 91
AdamsP
  • 17
  • 4

1 Answers1

0

From the Github project in the question theser is a sample that show how to use NX_VidEncJpegRunFrame (in NXJpegHWEnc.cpp).

You can allocate the structure NX_VID_ENC_OUT on the stack, the output buffer will be allocated by NX_VidEncJpegRunFrame :

NX_VID_ENC_OUT encOut;
NX_VidEncJpegRunFrame(hEnc, &memInfo, &encOut);

Next you can access to buffer encOut.outBuf of encOut.bufSize.

mpromonet
  • 11,326
  • 43
  • 62
  • 91