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.

dm816x v4l2 capture problem(gstreamer v4l2src and videomixer)

Hello ,

I have installed v4l2 capture driver successfully and it's work when I capture the component input via gstreamer pipeline:

gst-launch -v v4l2src device="/dev/video0" queue-size=3 ! 'video/x-raw-yuv-strided,format=(fourcc)YUY2,width=1920,height=1080,framerate=(fraction)30/1' ! omxbufferalloc numBuffers=3 ! gstperf ! v4l2sink device="/dev/video1" sync=false

now, i want to do videomixer with other file source:

gst-launch omx_videomixer framerate=30 port-index=0 name=mix ! v4l2sink userpointer=true v4l2src device="/dev/video0" queue-size=3 ! 'video/x-raw-yuv-strided,format=(fourcc)YUY2,width=1920,height=1080,framerate=(fraction)30/1' ! omxbufferalloc numBuffers=3 ! ffmpegcolorspace ! gstperf ! mix. filesrc location=sample1.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample2.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample3.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

but it's not work!!

request pad!!
creating pad with name:sink_00
pad class init!!
Setting sink pad:0
request pad done ret!!
request pad!!
creating pad with name:sink_01
Setting sink pad:1
request pad done ret!!
request pad!!
creating pad with name:sink_02
Setting sink pad:2
request pad done ret!!
request pad!!
creating pad with name:sink_03
Setting sink pad:3
request pad done ret!!
Setting pipeline to PAUSED ...

** (gst-launch-0.10:1675): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &d

** (gst-launch-0.10:1675): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &d

** (gst-launch-0.10:1675): CRITICAL **: gst_v4l2sink_sync_flip: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &contd
Video mixer activate push!!
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2778): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...

!!!!!!!!!unreference all the remaining buffers!!!!!!!!!Video mixer activate push!!
paused to ready...done!!
calling g_omx_core_deinit
Freeing pipeline ...

Am I missing something?

thanks!

Regards,

Steven

  • Hello,

    You could check here for examples with video mixer:

    http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Pipelines

    Best regards,

    Margarita

  • Hello,

    Thanks for reply!

    I have modified pipeline ...

    (1) Component input (1080p60) capture and encode to "v4l2capX.h264":

    gst-launch v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! gstperf ! filesink location=v4l2cap.h264

    (2) Videomixer 2 video : v4l2cap1.h264, v4l2cap2.h264(two file are the same. just copy...)

    gst-launch omx_videomixer framerate=30 port-index=0 name=mix ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=false filesrc location=v4l2cap1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=v4l2cap2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

    It works well and the following is "gstperf" message.

    perf0: frames: 49       current: 48.12   average: 48.12 arm-load: 15            
    perf0: frames: 97       current: 47.01   average: 47.57 arm-load: 31            
    perf0: frames: 143      current: 45.95   average: 47.03 arm-load: 37            

    why frame rate is 47?

    (3) Videomixer 3 video : v4l2cap1.h264, v4l2cap2.h264, v4l2cap3.h264(all file are the same)

    gst-launch omx_videomixer framerate=30 port-index=0 name=mix ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=false filesrc location=v4l2cap1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=v4l2cap2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=v4l2cap3.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

    Pipeline is hang...:

    request pad!!                                                                   
    creating pad with name:sink_00                                                  
    pad class init!!                                                                
    Setting sink pad:0                                                              
    request pad done ret!!                                                          
    request pad!!                                                                   
    creating pad with name:sink_01                                                  
    Setting sink pad:1                                                              
    request pad done ret!!                                                          
    request pad!!                                                                   
    creating pad with name:sink_02                                                  
    Setting sink pad:2                                                              
    request pad done ret!!                                                          
    Setting pipeline to PAUSED ...                                                  
    Video mixer activate push!!                                                     
    Pipeline is PREROLLING ...

    What happened?

    (4) Videomixer 3 video : v4l2cap1.h264, v4l2cap2.h264, component input source(/dev/video0)

    gst-launch omx_videomixer framerate=30 port-index=0 name=mix ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=false filesrc location=v4l2cap1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=v4l2cap2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. v4l2src device="/dev/video0" always-copy=false queue-size=12 !'video/x-raw-yuv-strided,format=(fourcc)NV12,width=19
    20,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! mix.

    Pipeline is work but...

    Component input display well but two h264 file play slowly....(play speed is slow...)

    It's frame rate or sync issue?

    videomixer frame rate=30, h264 file frame rate=47,component input : 1080p60, display mode : OMX_DC_MODE_1080P_60

    It's confuse me...

    Any suggestion will highly appreciate!

    thanks a lot

    Steven

  • Hello Steven,

    What is your EZSDK version?

    Best regards,

    Margartia

  • Hello,

    I'm using EZSDK 5.05.

    Videomixer 3 video:

    gst-launch -v omx_videomixer framerate=60 port-index=0 name=mix ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=true filesrc location=demo.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=demo.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=demo.264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

    perf0: frames: 60     current: 31.82     average: 29.54    arm-load: 64
    perf0: frames: 92     current: 31.64     average: 30.24    arm-load: 61
    perf0: frames: 124     current: 31.62     average: 30.58    arm-load: 56
    perf0: frames: 156     current: 31.23     average: 30.71    arm-load: 55
    perf0: frames: 188     current: 31.94     average: 30.92    arm-load: 52

    works fine for me does not hangs.

    gst-launch omx_videomixer framerate=30 port-index=0 name=mix ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf ! omx_videosink sync=false filesrc location=v4l2cap1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=v4l2cap2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. v4l2src device="/dev/video0" always-copy=false queue-size=12 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=19
    20,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! mix.

    sync should be true.

    Let me know the results.

    Best regards

    Margarita

  • Hi Margarita,

    I'm currently using EZSDK 5.04.00.11, do you know what revision of the OMX plugins / branch should I use to get stable functionality of the v4l2src element? Do you have a link to the tested Gstreamer pipelines that I could use in my development?

    Thanks

    Diego

  • Hello Margarita,

    Thanks for quick reply!

    I am using EZSDK 5.05.01.04 too.

    (1) Videomixer 3 video also hangs...but mix 2 video works fine!

    It's frame rate issue? My file frame rate is about 47.  I will try another frame rate or resolution.

    (2) set sync be true is useless.

    I think that problem is v4l2src issue. Because when i removed v4l2src. Everything will be ok ! (Just videomixer 2 video from file)

    Any suggestion ?

    Thank you very much!

    Best regards,

    Steven

  • Hello Steven,

    I will investigate this issue.

    Best regards,

    Margarita

  • Hello Diego,

    You could download the new EZSDK 5.05 (with omx_05_02_00_46).

    Gstreamer pipelines(examples):

    http://processors.wiki.ti.com/index.php/DM81xx_Gstreamer_Pipelines

    Best Regards,

    Margarita

  • Hi Margarita,

    I am  terribly sorry ...  My EZSDK version is 5.04.0.11.

    After I update to the latest EZSDK version 5.05.01.04. The videomixer 3 video works well now!! Then I have tried 4 video mix and pipeline is hangs... It's because overloading? All video are 1080P60. (I know that HDVICP2 max. capability is 3x1080P60)

    And unfortunately the v4l2 capture pipeline does not work now on the EZSDK 5.05.01.04.

    It seems v4l2 capture over component works on the 5.04.0.11 but does not work on the 5.05.01.04?

    the pipeline is below...component input source is 1080P60

    gst-launch v4l2src always-copy=false queue-size=12 num-buffers=2000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)60/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! gstperf ! filesink location=v4l2cap.h264

    Could you test this pipeline on the 5.05.01.04 at your side?

    Thank you very much!

    Best regards, 

    Steven

  • Hello Steven,

    I will check it and I will let you know the result.

    Best Regards,

    Margarita

  • Hello Steven,

    Please check here: http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/228258/812203.aspx

    and let me know the result.

    Best Regards,

    Margarita

  • Hi All,

    I find this topic relevant to me, so posting my query in continuation to what you guys are discussing.

    I'm using following pipeline to mix png image with video file.

    gst-launch omx_videomixer name=mix \
            ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! gstperf \
            ! omx_videosink sync=false  \
            filesrc location=Sample.mp4 ! 'video/x-h264' \
            ! h264parse access-unit=true ! omx_h264dec ! mix. \
        filesrc location=Sample.png \
        ! pngdec ! queue ! ffmpegcolorspace \
        ! imagefreeze !  mix.

    The output of gst-launch command.

    In base init!!
    In class init!!
    In instance init!!
    queue_0 : 0x147e98
    queue_1 : 0x147eb0
    queue_2 : 0x147ec8
    queue_3 : 0x147f00
    In instance init/...done!!
    Setting pipeline to PAUSED ...
    Video mixer activate push!!
    Pipeline is PREROLLING ...
    In sink set caps:video/x-raw-yuv, format=(fourcc)NV12, width=(int)866, height=(int)90, framerate=(fraction)25/1
    Starting input thread!!
    omx_setup!!
    omx_setup...done!!

    As you can notice, the pipeline waits in 'PREROLLING' state and does not transit in PLAYING state. I tested omx_videomixer with single video file and got same result. Even for single video file, PIPELINE did not transit to PLAYING state.

    1. Is omx_videomixer immature element in EZSDK-5.3.1.15 ?

    2. Is it necessary to upgrade EZSDK to 5.5.2.0 version to use omx_videomixer?

    Thanks,

    Rajnikant

  • Hello,

    You can open new thread  for this issues.

    Best Regards,

    Margarita