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.

video decode AM57xx

Hi experts,

I download the SW from http://software-dl.ti.com/processor-sw/esd/PROCESSOR-SDK-LINUX-AM57X/latest/index_FDS.html and

got failure as trying to decode jpeg as below.

Does I miss anything else ??  According to http://processors.wiki.ti.com/index.php/Processor_Training:_Multimedia , JPEG is supported.

root@am57xx-evm:/run/media/sda1# viddec3test -s 30:1920x1080 JPEG1080.jpg
0x2c070: Opening Display..
using 1 connectors, 800x480 display, multiplanar: 1
0x2c070: Opening Demuxer..
Input #0, image2, from 'JPEG1080.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 1920x1090 [PAR 96:96 DAR 192:109], 25 tbn
ERROR:open_stream:88: could not open 'JPEG1080.jpg': unsupported codec 8
ERROR:decoder_open:152: 0x2c070: could not open demuxer
root@am57xx-evm:/run/media/sda1#

I try to decode H264 and it's ok. 

root@am57xx-evm:/run/media/sda1# viddec3test -s 30:1920x1080 out.h264
0x2c070: Opening Display..
using 1 connectors, 800x480 display, multiplanar: 1
0x2c070: Opening Demuxer..
[h264 @ 0x2d6e0] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from 'out.h264':
Duration: N/A, bitrate: N/A
Stream #0.0: Video: h264 (Constrained Baseline), yuv420p, 1920x1080, 25 fps, 25 tbr, 25 tbn
0x2c070: infile=out.h264, width=1920, height=1080
0x2c070: padded_width=2048, padded_height=1184, num_buffers=7
Setting mode 1920x1080 on connector 30, crtc 32
0x2c070: Opening Engine..
displayBufsMode: 1
0x2c070: end of input
ERROR:decoder_process:403: 0x2c070: process returned error: -1
ERROR:decoder_process:404: 0x2c070: extendedError: 00040000
root@am57xx-evm:/run/media/sda1#

Thanks

  • Hi 

    Demuxer provided here supports only H264, MPEG4 and MPEG2 video formats.

    You can try gstreamer pipeline to decode jpeg images.

  • Hi Ramprasad,
    thanks for your quick response.

    I have tried with following command, and it's ok.
    gst-launch-1.0 -v playbin uri=file:///run/media/sda1/1080p.mjpeg video-sink="fpsdisplaysink sync=false" flags=1


    In our application, we won't use gstreamer. So we're developing based on viddectest.
    Could you give a hint on enabling mjpeg in viddectest ??

    Thanks.
  • You can modifiy viddec3test.c to support jpeg streams.
    1) Remove all demux related code as it is not required now. Instead of demux_read, now read complete jpeg of one frame
    2) Call VIDDEC3_create with "ivahd_jpegvdec" as the second argument.
    3) padded_width and padded_height will be same as width and height for jpeg.
    Rest of the code should work as it is and you don't need more than one output buffer I guess.

    Ram
  • hi Ram,

    thanks for your reply.

    I remove the demux_ function and add the following

    first_in_buff = 1;
    MSG("codec_id: CODEC_ID_MJPEG\n");
    decoder->codec = VIDDEC3_create(decoder->engine, "ivahd_jpegvdec", decoder->params);
    if (!decoder->codec) {
    ERROR("%p: could not create codec", decoder);
    goto fail;
    }

    and I got error messages as below

    root@am57xx-evm:~# ./viddec3test -s 30:1920x1080 JPEG1080.jpg
    0x1c070: Opening Display..
    using 1 connectors, 800x480 display, multiplanar: 1
    From util.c >>> display fps = 0
    0x1c070: Opening Demuxer..
    Input #0, image2, from 'JPEG1080.jpg':
    Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 1920x1080 [PAR 96:96 DAR 192:109], 25 tbr, 25 tbn, 25 tbc
    0x1c070: infile=JPEG1080.jpg, width=1920, height=1080
    0x1c070: padded_width=1920, padded_height=1088, num_buffers=7
    Setting mode 1920x1080 on connector 30, crtc 32
    0x1c070: Opening Engine..
    displayBufsMode: 1
    ERROR:decoder_open:276: 0x1c070: could not create codec
    root@am57xx-evm:~#

    Is there something wrong ?? parameters or ??

    Thanks
  • Set decoder->params->numOutputDataUnits = 1;
    Decoder is expecting this value to be 1
  • Yes, man.    Thanks Ram
    You're right.

    root@am57xx-evm:~# ./viddec3test -s 30:1920x1080 /run/media/sda1/1080p.mjpeg
    ndecoders = 0

    0x1c070: Opening Display..
    using 1 connectors, 800x480 display, multiplanar: 1
    From util.c >>> display fps = 0
    0x1c070: Opening Demuxer..
    [mjpeg @ 0x1db40] Estimating duration from bitrate, this may be inaccurate
    Input #0, mjpeg, from '/run/media/sda1/1080p.mjpeg':
    Duration: N/A, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 1920x1080, 25 fps, 25 tbr, 1200k tbn, 1200k tbc
    0x1c070: infile=/run/media/sda1/1080p.mjpeg, width=1920, height=1080
    0x1c070: padded_width=1920, padded_height=1088, num_buffers=7
    Setting mode 1920x1080 on connector 30, crtc 32
    0x1c070: Opening Engine..
    displayBufsMode: 1
    Entering dec operation....

    average fps = 94.29
    0x1c070: end of input
    ERROR:decoder_process:464: 0x1c070: process returned error: -1
    ERROR:decoder_process:465: 0x1c070: extendedError: 00000000
    root@am57xx-evm:~#