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.

AM5708: ducatijpegdec always wait for keyframes

Part Number: AM5708

Hi,

I am using am5708 and ti-processor-sdk-linux-am57xx-evm-04.03.00.05.

I want to use gstreamer to capture an OV5640 usb camera, which is support for mjpeg 1080P@15fps, 720P@30fps

Here is my command, use jpegdec and avdec_mjpeg, which is successfully, but cpu load is 93%

root# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! jpegdec ! videoconvert ! kmssink sync=false scale=false

root# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! queue ! avdec_mjpeg ! videoconvert ! kmssink sync=false scale=false

Use dec hardware codec to reduce CPU load, ducatijpegdec:
root# gst-launch-1.0 --gst-debug=4 v4l2src device=/dev/video1 num-buffers=1000 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! queue ! ducatijpegdec ! videoconvert ! kmssink sync=false scale=false

The program works abnormally and gets stuck in a loop "ducati gstducatividdec.c:1309:gst_ducati_viddec_do_qos:<ducatijpegdec0> skipping until the next keyframe"

at gst-plugin-ducati/src/gstducatividdec.c, the "self->wait_keyframe" is always true, and cannot be modified by parameter passing

In order to confirm whether it is a key frame problem, I used an encode -> decode command, which is successfully.
root# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=-1 io-mode=4 ! 'image/jpeg,width=1280,height=720,framerate=30/1' ! queue ! avdec_mjpeg ! videoconvert ! "video/x-raw,width=1280,height=720,format=NV12" ! queue ! ducatijpegenc ! ducatijpegdec ! kmssink sync=false scale=false

Here is my questions:

1. why ducatijpegdec design to always wait for keyframe? which is useful for .mov files, but do not useful for v4l2src mjpeg video stream?

2. How to rebuild the gst-plugin-ducati?

If you have any idea, please let me know it.

Thanks.

  • Hi Chen,

    Ideally Key frame is required only for video codecs like h264, mpeg4dec but it should wait for key frame in case of jpeg streams as they have only intra frames which can be decoded individually.

    There is some difference between .mov decoding and v4l2src decoding which is causing the issue.

    Can you enable run this command 

    export GST_DEBUG=ducati:5

    and then execute mov playback and similarly v4l2src USB decoding . With the traces you should be able to identify.

    You need to use yocto for rebuilding gstreamer. There is no alternative.

    Thanks

    RamPrasad

  • Hi, RamPrasad

    Thanks for your reply.

    I modify wait_key_frame from TRUE to FALSE, rebuid it.

    I can use gstducatijpegdec capture v4l2 mjpeg video stream successfully, I think this is the root of the problem I am currently experiencing.

    Thanks for your help. If TI have plans to improve this problem, please let me know.

    Thanks.