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.

omx_mjpegdec problem

Hi,
I'm trying to render a mjpeg stream using gstreamer on DM8148 EVM.
First, I enter following command ,and it can work success.
root@dm814x-evm:~#gst-launch -v v4l2src ! image/jpeg,width=640,height=480 ! jpegdec
! ffmpegcolorspace ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink
sync=false
Then ,I exec the command "gst-inspect omx_mjpegdec",and show the following:
        Factory Details:
        Long name: OpenMAX IL JPEG/MJPEG decoder
       Class: Codec/Decoder/Video
       Description: Decodes video/images in MJPEG/JPEG format with OpenMAX IL
       Author(s): Felipe Contreras
        Rank: primary (256)
It means that omx_mjpegdec can decode the jpeg format picture.
So I want to use omx_mjpegdec substitute jpegdec,
root@dm814x-evm:~# gst-launch -v v4l2src ! image/jpeg,width=640,height=480 ! omx_mjpegdec !
omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false

But it error:

Setting pipeline to PAUSED ...

Mode set is 0

/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg, width=(int)640,
height=(int)480, framerate=(fraction)24/1
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
N
..........
/GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:sink: caps = image/jpeg, width=
(int)640, height=(int)480, framerate=(fraction)24/1
/GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:src: caps = video/x-raw-yuv-strided,
width=(int)640, height=(int)480, format=(fourcc)NV12, rowstride=(int)640, framerate=
(fraction)24/1, interlaced=(boolean)false
unrecoverable error: There were insufficient resources to perform the requested operation
(0x80001000)
ERROR: from element /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0: GStreamer encountered
a general stream error.
Additional debug info:
gstomx_base_filter.c(659): pad_chain (): /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0:
Error from OpenMAX component
Execution ended after 217246400 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Recieved EOS event, press <CTRL+C> to terminate pipeline.
Recieved EOS event, press <CTRL+C> to terminate pipeline.
/GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:sink: caps = NULL
....
Setting pipeline to NULL ...
Freeing pipeline ...


Could anyone tell me the error reason and how I can use omx_mjpegdec success.

Thanks !

  • Hello,

    You could try  below gst pipeline:

    MJPEG in MOV container format

    gst-launch -v filesrc location='test.MOV' ! qtdemux name=demux demux.video_00 ! queue ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink

    MJPEG Elementry Stream

    gst-launch -v filesrc location= test.jpeg ! typefind ! jpegparse ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=false

    or you could try for example:

    gst-launch  v4l2src !'image/jpeg, width=640, height=480, framerate=(fraction)30/1' !  ffdec_mjpeg  ! ffmpegcolorspace ! 'video/x-raw-yuv,format (fourcc)YUY2, width=640, height=480, framerate=(fraction)30/1' ! gstperf  ! v4l2sink userpointer=false

    or

    gst-launch  v4l2src !'image/jpeg, width=640, height=480, framerate=(fraction)30/1' !  omx_mjpegdec  ! ffmpegcolorspace ! 'video/x-raw-yuv,format (fourcc)YUY2, width=640, height=480, framerate=(fraction)30/1' ! gstperf  ! v4l2sink userpointer=false

    Best Regards,

    Margarita

  • Hello,Margarita Gashova,Thank you for you reply.
    I have try the gst pipleline you suggested.

    1:The gst pipleline is ok.And it work success.
    gst-launch v4l2src !'image/jpeg, width=640, height=480, framerate=(fraction)30/1' ! ffdec_mjpeg ! ffmpegcolorspace !
    'video/x-raw-yuv,format (fourcc)YUY2, width=640, height=480, framerate=(fraction)30/1' ! gstperf ! v4l2sink
    userpointer=false

    ----------------------------------------------
    2:I don't have a *.jpeg picture ,but I have one *.jpg picture. the gst pipleline run fail!
    root@dm814x-evm:~# gst-launch -v filesrc location= img1.jpg ! typefind ! jpegpar
    se ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gs
    tperf ! omx_videosink sync=false
    Setting pipeline to PAUSED ...
    ........
    /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:src: caps = video/x-raw-yuv-strided, width=(int)1280, height=
    (int)720, format=(fourcc)NV12, rowstride=(int)1280, framerate=(fraction)1/1, interlaced=(boolean)false
    unrecoverable error: There were insufficient resources to perform the requested operation (0x80001000)
    ERROR: from element /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0: GStreamer encountered a general stream error.
    Additional debug info:
    gstomx_base_filter.c(659): pad_chain (): /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0:
    Error from OpenMAX component
    ERROR: pipeline doesn't want to preroll.
    Setting pipeline to NULL ...
    Recieved EOS event, press <CTRL+C> to terminate pipeline.
    Recieved EOS event, press <CTRL+C> to terminate pipeline.
    .............
    Freeing pipeline ...
    root@dm814x-evm:~#

    Then I try to print more debug imformation via following pipleline:
    root@dm814x-evm:~# gst-launch -v filesrc location= img1.jpg ! typefind ! jpegpar
    se ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gs
    tperf ! omx_videosink sync=false --gst-debug=3
    ..........
    /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:sink: caps = image/jpeg, parsed=(boolean)true, format=(fourcc)
    UYVY, interlaced=(boolean)false, width=(int)1280, height=(int)720, framerate=(fraction)1/1
    0:00:05.568785050 1499 0x167760 INFO omx gstomx_base_filter.c:545:pad_chain:<omxmjpegdec0> omx:
    prepare
    0:00:05.568890600 1499 0x167760 INFO omx gstomx_base_videodec.c:445:omx_setup:<omxmjpegdec0> begin
    0:00:05.905932300 1499
    notify_shm_drv_sendevent failed! status = 0xfffffff2 0x167760
    otify_send_event failed! status = 0xfffffff2;01mINFO
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2 omx gstomx_base_videodec.c:459:omx_setup:<omxmjpegdec0> end
    0:00:05.908002050 1499 0x167760 WARN omx gstomx_base_filter.c:822:buffer_alloc:<omxmjpegdec0> faking
    settings changed notification
    setcaps (src): 0x16bc60

    it means I get the error:
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2
    ------------------------------------------------------
    3:The reasult of the following gst pipleline run is same to the sencond gst pipleline.

    Following is my dm8148EVM's bootargs,the ezsdk version is ezsdk_5_05_01_04,the gst-openmax is get from https://gstreamer.ti.com/svn/gstreamer_ti/trunk/gstreamer_ti_dm81xx

    setenv bootargs console=ttyO0,115200n8 rootwait rw mem=364M@0x80000000 mem=320M@0x9FC00000 vmalloc=500M notifyk.vpssm3_sva=0xBF900000 root=/dev/nfs nfsroot=192.168.1.200:/home/be/targetfs ip=dhcp
    setenv serverip '192.168.1.200';tftp 0x82000000 uImage-dm814x-evm.bin;
    setenv bootcmd 'tftpboot 0x82000000 uImage-dm814x-evm.bin;bootm 0x82000000';

    please help me!

    Thank you!

  • Hello,

    In most cases this error means  your bootargs are wrong.:

    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2
    notify_shm_drv_sendevent failed! status = 0xfffffff2
    notify_send_event failed! status = 0xfffffff2

    There are separate set of bootargs for EZSDK which should be mentioned in EZSDK user guide.

    Best Regards,

    Margarita

  • Hello,

    You could check here about omx_mjpegdec:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/207597.aspx

    and let me know the result.

    Best Regards,

    Margarita

  • Hi, Margarita Gashova

    gstreamer in 5.05 has a bug that prevents the gstreamer omx_mjpeg decode component from working. The fix for that is attached to this post and is included in the define SDOCM00097118.

    sdocm00097118.zip

    After I fix it,the following gst pipleline can work,it can decode the mjpeg streamer via omx_mjpegdec

    root@dm814x-evm:~# gst-launch -v filesrc location= test.mjpeg ! typefind ! jpegparse ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink

    But when I was trying decode mjpeg streamer from a usb camera,but it fail..A and B 's results is same .unrecoverable error..........

    A:root@dm814x-evm:~#gst-launch  v4l2src !'image/jpeg, width=640, height=480, framerate=(fraction)24/1' !  omx_mjpegdec  ! ffmpegcolorspace !  video/x-raw-yuv,format (fourcc)YUY2, width=640, height=480 ! gstperf  ! v4l2sink userpointer=false

    B:root@dm814x-evm:~# gst-launch -v v4l2src ! image/jpeg,width=640,height=480 ! typ
    efind ! jpegparse ! omx_mjpegdec ! omx_scaler ! omx_ctrl display-mode=OMX_DC_MO
    DE_1080P_60 ! gstperf ! omx_videosink

    Setting pipeline to PAUSED ...
    ...........
    /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:sink: caps = image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)24/1
    /GstPipeline:pipeline0/GstJpegParse:jpegparse0.GstPad:sink: caps = image/jpeg, width=(int)640, height=(int)480, framerate=(fraction)24/1
    /GstPipeline:pipeline0/GstJpegParse:jpegparse0.GstPad:src: caps = image/jpeg, parsed=(boolean)true, format=(fourcc)UYVY, interlaced=(boolean)false, width=(int)640, height=(int)480, framerate=(fraction)24/1
    /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:sink: caps = image/jpeg, parsed=(boolean)true, format=(fourcc)UYVY, interlaced=(boolean)false, width=(int)640, height=(int)480, framerate=(fraction)24/1
    /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:sink: caps = image/jpeg, parsed=(boolean)true, format=(fourcc)UYVY, interlaced=(boolean)false, width=(int)640, height=(int)480, framerate=(fraction)24/1
    /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0.GstPad:src: caps = video/x-raw-yuv-strided, width=(int)640, height=(int)480, format=(fourcc)NV12, rowstride=(int)640, framerate=(fraction)24/1, interlaced=(boolean)false
    unrecoverable error: There were insufficient resources to perform the requested operation (0x80001000)
    ERROR: from element /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0: GStreamer encountered a general stream error.
    Additional debug info:
    gstomx_base_filter.c(659): pad_chain (): /GstPipeline:pipeline0/GstOmxMJPEGDec:omxmjpegdec0:
    Error from OpenMAX component
    Execution ended after 215233950 ns.
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Recieved EOS event, press <CTRL+C> to terminate pipeline.
    Recieved EOS event, press <CTRL+C> to terminate pipeline.
    ..........
    Setting pipeline to NULL ...
    Freeing pipeline ...

    the ezsdk version is ezsdk_5_05_01_04,the gst-openmax is lastest get from https://gstreamer.ti.com/svn/gstreamer_ti/trunk/gstreamer_ti_dm81xx

    Could you give me some suggestions.

    Thanks!