This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to use JPEG encode on Dm365evm?

Greetings:

As the dvsdk document mentioned, the .264 and .mpeg4 extension could be used to encode video to corresponding codecs.

When I use .jpeg extension, the programme told me that it was an unknown extension.

So how can I use jpeg codec by using the dvsdk demo?

Thanks!

Btw: Is UYVY colorspace encoding supported in the dvsdk?

In addition:  I have added some codes to the encode.cfg and codecs.c, but that doesn't work.

var JPEGENC = xdc.useModule('ti.sdo.codecs.jpegenc.ce.JPEGENC');

var myEngine = Engine.create("encode", [

    {name: "mpeg4enc", mod: MPEG4ENC, local: true, groupId: 1},
    {name: "h264enc", mod: H264ENC, local: true, groupId: 1},

    {name: "jpegenc", mod: JPEGENC, local: true, groupId: 1},
    {name: "g711enc", mod: G711ENC, local: true},
]);

After adding the CE_DEBUG=1 before the invoke ./encode command, the message on the console window is as below:

@2,642,432us: [+6 T:0x42e22490] CE - Engine_getConstName> Unable to locate alg "
jpegenc" (type "ti.sdo.ce.video1.IVIDENC1").
@2,642,666us: [+6 T:0x42e22490] CV - VISA_create2> Unable to locate alg "jpegenc
".
@2,642,821us: [+7 T:0x42e22490] ti.sdo.dmai - [Venc1] Failed to open video encod
e algorithm: jpegenc (0x0)
Error: Failed to create video encoder: jpegenc

Best Regards;

  • Hi Leon,

    DVSDK by default does not support JPEG ENC. You can refer to DVTB code that is provided in DVSDK package. It supports JPEG ENC.

     

    The problem i see from the information on console is that you are using IVIDENC1 class for creating JPEG ENC. You should instead use IMGENC1 class interface to call JPEG ENC. A code snipped is given below:

     

     IMGENC1_Params          params;
        XDAS_Int32              status;
        char                    algName[20];
        IMGENC1_Handle          hEncode;
        IJPEGENC_DynamicParams  extDynParams;

        algName = "jpegenc";

     /* allocate and initialize image encoder on the engine */
        params.size = sizeof(IMGENC1_Params);
        params.maxWidth = 736;
        params.maxHeight = 480;
        params.maxScans = 1;
        params.dataEndianness = XDM_BYTE;
        params.forceChromaFormat = 1;
        hEncode = IMGENC1_create(hEngine, algName, &params);
        if (hEncode == NULL) {
            ERR("Failed to open jpeg encode algorithm: %s (0x%x)\n",
                algName, Engine_getLastError(hEngine));
            return FAILURE;
        }


    Regards,

    Anshuman