• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » Linux » Linux forum » Mosaic example using gstreamer on 8168 (EZSDK version 5_04_00_11)
Share
Linux
  • Forum
Options
  • Subscribe via RSS

Forums

Mosaic example using gstreamer on 8168 (EZSDK version 5_04_00_11)

This question is answered
Frank Huber
Posted by Frank Huber
on Aug 02 2012 07:46 AM
Prodigy125 points

Hi,

we try the gstreamer mosaic example on our demo board 816x/389x EVM.

gstreamer pipeline:

gst-launch omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_3.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_4.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

The result is

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 ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video1'.
Additional debug info:
v4l2_calls.c(493): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...

Does anyone know why /dev/video1 is missing?

Br
Frank

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Ansari
    Posted by Ansari
    on Aug 03 2012 06:18 AM
    Prodigy505 points

    Frank,

    Please provide the stream resolution for the sample streams and EZSDK version used in your test setup

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 03 2012 06:23 AM
    Prodigy125 points

    Ansari,

    the EZSDK version is 05_04_00_11

    The stream resolution is 1280x720@24

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 03 2012 06:29 AM
    Prodigy505 points

    FYI Each 720p H.264 decoder instance needs approx 7.5 MB internal memory which is allocated from the memory segment VIDEO_M3_INT_HEAP_CACHED (pls refer to the firmware loader file $(EXSDK)/board-support/media-controller-utils_2_05_00_17/src/firmware_loader/memsegdef_default.c). The default size of this segment is 24 MB, which can support upto three 720p decoder instances. With the default memory setup you will be able to run upto three 720p instances.You have to increase the memory VIDEO_M3_INT_HEAP_CACHED to approx 30 MB to run 4 channel 720p h264 streams

     You need to modify the memsegdef_default.c. The default EZSDK memory map is given in this wiki http://processors.wiki.ti.com/index.php/EZSDK_Memory_Map . The memory sections given in green colour in the wiki can be modified via firmware loader module and the pre-built firmware binaries can be used as it is. I've attached a sample modified firmware loader memsegdef_default.c file where I've reduced the CMEM and DSP_ALG_HEAP segment sizes and increased the VIDEO_M3_INT_HEAP_CACHED size from 24 MB to 30 MB.  Following are the steps

    1. Re-build the firmware loader after modifying the memsegdef_default.c with the command  "make media-controller-utils" from the top level EZSDK directory
    2. firmware loader binary firmware_loader_a8host_debug.xv5T will be generated at board-support/media-controller-utils_2_05_00_17/lib/firmware_loader/bin/ti814x-evm
    3. Rename the firmware loader binary to firmware_loader
    4. Replace the existing firmware_loader with the new firmware_loader binary in the target filesystem at /usr/bin
    5. Re boot the board and test the usecase

    Regards

    Ansari

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 03 2012 08:29 AM
    Prodigy125 points

    Ansari,

    thanks for your answer.

    After doing all your steps there is another error message.

    gst-launch omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_3.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_4.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.
    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 ...
    ERROR: Pipeline doesn't want to pause.
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video1'.
    Additional debug info:
    v4l2_calls.c(493): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
    system error: No such file or directory
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Br
    Frank

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 03 2012 09:28 AM
    Prodigy505 points

    Huber,

    Are you able to run a single channel with the command

    "gst-launch omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix."

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 03 2012 09:56 AM
    Prodigy505 points

    Huber,

    Looks like V4l2 in not enabled in your setup. Please try the following commands

    1. Boot the board and log in as "root"
    2. cd /usr/share/ti/ti-media-controller-utils
    3. cp load-hd-v4l2-firmware.sh /etc/init.d/load-hd-firmware.sh ( load-hd-v4l2-firmware.sh enables v4l2)
    4. type "sync"
    5. Restart the board
    6. Type "echo 0 > /sys/devices/platform/vpss/graphics0/enabled"
    7. Run the gstpipe line

    The detailed steps are available in DM816x_EZ_Software_Developers_Guide.pdf under "docs" section Look for the sections "How to change from OMX to V4L2 firmware for capture/display"

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 06 2012 03:28 AM
    Prodigy125 points

    Ansari,

    thanks for your answer.

    After your recommended steps there is a mosaic visible.
    But only the first frame of the videos. The videos are not playing (looks like paused).

    Same when I start one video only.

    the printouts are now:

    gst-launch omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h2
    64 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc lo
    cation=sample_2.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec
     ! mix. filesrc location=sample_3.h264 ! 'video/x-h264' ! h264parse access-unit=
    true ! omx_h264dec ! mix. filesrc location=sample_4.h264 ! 'video/x-h264' ! h264
    parse access-unit=true ! omx_h264dec ! mix.
    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:1395): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed

    ** (gst-launch-0.10:1395): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed

    ** (gst-launch-0.10:1395): CRITICAL **: gst_v4l2sink_sync_flip: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed
    Video mixer activate push!!
    Pipeline is PREROLLING ...
    In sink set caps:video/x-raw-yuv-strided, width=(int)1280, height=(int)720, format=(fourcc)NV12, rowstride=(int)1408, framerate=(fraction)240
    00/1001, interlaced=(boolean)false
    ip width:1280, ip height: 720, ip stride:1408
    Starting input thread...num sink pads:4
    ip zorder - starting from lowest: 0, 1, 2, 3
    In sink set caps:video/x-raw-yuv-strided, width=(int)1280, height=(int)720, format=(fourcc)NV12, rowstride=(int)1408, framerate=(fraction)240
    00/1001, interlaced=(boolean)false
    ip width:1280, ip height: 720, ip stride:1408
    In sink set caps:video/x-raw-yuv-strided, width=(int)1280, height=(int)720, format=(fourcc)NV12, rowstride=(int)1408, framerate=(fraction)240
    00/1001, interlaced=(boolean)false
    ip width:1280, ip height: 720, ip stride:1408
    In sink set caps:video/x-raw-yuv-strided, width=(int)1280, height=(int)720, format=(fourcc)NV12, rowstride=(int)1408, framerate=(fraction)240
    00/1001, interlaced=(boolean)false
    ip width:1280, ip height: 720, ip stride:1408
    created output caps:video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fourcc)YUY2, framerate=(fraction)15/1
    In src set caps:video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fourcc)YUY2, framerate=(fraction)15/1
    set src_setcaps  height:720, width:1280
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock

    Br

    Frank

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 06 2012 04:11 AM
    Prodigy505 points

    Frank,

    I've tried a sample 720 H.264 stream with the above pipe line and the play quality looked fine. It could be a stream specific issue.Please let me know the stream name and its online availability. Also try with a different stream

    Ansari

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 06 2012 04:26 AM
    Prodigy125 points

    Ansari,

    the stream is available in my dropbox.

    https://www.dropbox.com/sh/ukd1py4htgb3wb6/qURx8oiNvX

    Let me know when you downloaded it.

    Br

    Frank

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 06 2012 06:16 AM
    Prodigy125 points

    Ansari,

    one more question.

    During boot there are two i2c messages:

    Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]

    Are this messages a normal behavior?

    See attached log.

    5127.netra-boot-log.txt

    Br
    Frank



    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Lo
    Posted by Lo
    on Aug 06 2012 06:48 AM
    Intellectual2760 points

    Hello Ansari,

    I do get the same messages when starting the load-hd-v4l2-firmware.sh at startup.

    I tried to add the -mmap /usr/share/ti/ti-media-controller-utils/mm_dm81xxbm.bin, the the firmware loader will load but the load fails (tvp7002 i2c error messages cause the system to loop forever).

    The default /etc/init.d/load-hd-firmware.sh specifies a mmap file that is not present (missing underscore) and the load-hd-v4l2-firmware.sh (in /usr/share/ti/ti-media-controller-utils/) does not work when copied to /etc/init.d/load-hd-firmware.

    Regards,

    Lo

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 06 2012 13:04 PM
    Prodigy505 points

    Frank,

    I've downloaded the stream.

    The i2c message is normal, the firmwares are getting loaded into two cores one after another

    Regards

    Ansari

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Frank Huber
    Posted by Frank Huber
    on Aug 08 2012 02:34 AM
    Prodigy125 points

    Ansari,

    are there any news?

    Could you test the downloaded stream?

    Here the situation is still the same. Starting one or four streams, the first frame is showed only.

    Here are the printouts when I start one stream. Maybe you can see a hint....

    gst-launch omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h2
    64 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.
    request pad!!
    creating pad with name:sink_00
    pad class init!!
    Setting sink pad:0
    request pad done ret!!
    Setting pipeline to PAUSED ...

    ** (gst-launch-0.10:1388): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed

    ** (gst-launch-0.10:1388): CRITICAL **: gst_v4l2sink_sync_rotation: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed

    ** (gst-launch-0.10:1388): CRITICAL **: gst_v4l2sink_sync_flip: assertion `v4l2_ioctl (fd, VIDIOC_S_CTRL, &control) >= 0' failed
    Video mixer activate push!!
    Pipeline is PREROLLING ...
    In sink set caps:video/x-raw-yuv-strided, width=(int)1280, height=(int)720, format=(fourcc)NV12, rowstride=(int)1408, framerate=(fraction)240
    00/1001, interlaced=(boolean)false
    ip width:1280, ip height: 720, ip stride:1408
    Starting input thread...num sink pads:1
    ip zorder - starting from lowest: 0
    created output caps:video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fourcc)YUY2, framerate=(fraction)15/1
    In src set caps:video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fourcc)YUY2, framerate=(fraction)15/1
    set src_setcaps  height:720, width:1280
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    Caught interrupt -- handling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 1599904096963 ns.
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...


    ---------------------------
    pressing control C after some minutes
    ---------------------------

    !!!!!!!!!unreference all the remaining buffers!!!!!!!!!Video mixer activate push!!
    paused to ready!!
    setting EOS to true
    Waiting for ip thread to exit..semup!!
    goto leave!!
    paused to ready...done!!
    Setting pipelinet81xx_vidout t81xx_vidout: VIDOUT0: invalid dequeue
     to NULL ...
    calling g_omx_core_deinit
    Freeing pipeline ...
    root@dm816x-evm:~/karnww01/frhu/netra/gst/ex80-play264#

    Br

    Frank

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 08 2012 07:49 AM
    Prodigy505 points

    Frank,

    I've downloaded the stream and able to recreate the hang issue with single stream. The stream profile shows its main profile 5.1 stream with num_ref_frame is set to 5.

    The decoder needs 2*num_ref_frames + 1 to decode the stream. So if the number of output buffers for omx_h264dec is set to 11, then the pipeline is working. We are still looking into this issue.

    Regards

    Ansari

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ansari
    Posted by Ansari
    on Aug 09 2012 13:24 PM
    Prodigy505 points
    h264dec_outbuffer_update.zip

    Frank,

    In the mosaic chain, the h264dec optimal buffer requirements is 11 ( 2*num_ref_frames + 1). num_ref_frames value can be obtained from the stream SPS param. For 720p streams, the out buffer requirement ranges from 8 to 15, depending on the profile. I've made the changes to support different h264 output buffer count and attached the patch. The following chain is verified with this patch

    gst-launch -v omx_videomixer name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h264 ! gstperf! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec output-buffers=8 ! mix. filesrc location=sample_2.h264   ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix. filesrc location=sample_3.h264   ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! mix.

    It is suggested always to check the "num_ref_frames" for the test streams, if its more than 5, then the h264dec output buffer count has to be updated. For ex if the num_ref_frames for a given stream is 6, then the h264dec output buffer can be updated to 12 with the following command

    gst-launch -v omx_videomixer port-index=0 name=mix ! v4l2sink userpointer=true filesrc location=sample_1.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec output-buffers=12 ! gstperf ! mix.

    Note : We are able to run upto 3 channels, there are further omx level changes required to enable four channel decode, pls let me know if this is your requirement. I'll go ahead and send you the steps required to enabled 4 channel decoding.   The following are the steps to test the patch

    1. Copy the attached patch to $(EZSDK)/component-sources/gst-openmax_GST_DM81XX_00_05_00_00/patches/

    2. cd to $(EZSDK)/component-sources/gst-openmax_GST_DM81XX_00_05_00_00

    3. Type the command patch -p1 < patches/h264dec_outbuffer_update.patch

    4. After the patch update, cd to the $(EZSDK) and type "make gstomx"

    5. Copy the generated libgstomx.so ( component-sources/gst-openmax_GST_DM81XX_00_05_00_00/omx/.libs/libgstomx.so) to the target file system (target/usr/lib/gstreamer-0.10)

    6. Test the mosaic usecase

    Regards

    Ansari

    Please mark this post as answered via the Verify Answer button below if you think it answers your question.  Thanks!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use