• 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 » Digital Signal Processors (DSP) » C6000 Multicore DSP » Keystone Multicore Forum (C66, 66A, AM5) » H.264 Encoder and RTP
Share
C6000 Multicore DSP
  • Forums
  • Announcements
Options
  • Subscribe via RSS
Training Available
TI provides self-paced online training that introduces the primary components of the KeyStone II family of SoC devices.

  • KeyStone II SoC Overview >
  • KeyStone II Software Overview >
  • KeyStone II ARM Cortex-A15 Corepac Overview >
  • More Information >
  • Check out
    Multicore Mix blog
    • $core_v2_blog.Current.Name

      Geeks UNITE for Geek Pride Day

      Posted 1 day ago
      by Lauren Reed1
      Happy Geek Pride Day from the Processors team! We wanted to celebrate...
    • $core_v2_blog.Current.Name

      OpenMP - All aboard!

      Posted 3 days ago
      by Debbie Greenstreet
      With so many end products today relying on multicore DSPs for...
    • $core_v2_blog.Current.Name

      A look back: Two years of Multicore Mix

      Posted 4 days ago
      by Lauren Reed1
      A big thank you to everyone who participated in our contest last...

    Forums

    H.264 Encoder and RTP

    This question is answered
    dp
    Posted by dp
    on May 09 2012 03:42 AM
    Intellectual975 points

    I want a demo that do H.264 encoder and send bitstream in RTP packet to Host. Where can I got it ? 

    I study sv01, but it's complicated. 

    My question is:

    1. sv01 is build based on mingw, how to convert it to a ccs_based project? and then modify and debug?

    2. It seems that there's RTP lib in sv01. How to add RTP to  transcode demo or "C:\Program Files\Texas Instruments\Codecs\C66x_h264venc_01_24_00_01_ELF\packages\ti\sdo\codecs\h264venc\App\Client\Build\TestAppEncoder\"  ?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 09 2012 14:46 PM
      Intellectual2960 points
      Hi dp,
      Can you please provide more details about your demo? Is it single channel (codec instance) with H.264 encoder? If it is encoder only, where is the YUV data coming from? Is the demo on evm6678l or DSPC8681?
      Assuming your target is single channel H.264 encoder_only and YUV data can come from TFTP, we can start with the transcode CCS example to bring in RTP processing:
      1) If it is Encode only, need to comment out the code for decoding in examples\transcode\source\videoTranscodeDecEnc.c. Also note that the code for reading YUV input for encoder is different from reading input for decoder. Please refer to dsp\siu\vct\siuVctEncode_xdm0p9.c to see how siuVct_ReadInputData() is used for reading YUV data for encoder. As the first step, we would recommend to keep the decoder and use H264 clip as the input.
      2) Additional components are needed for RTP processing. Please add the following items in Project Properties->C6000 Linker->File Search Path: --library
      "ti/mas/rfcs/ce66/rfcs_c.ae66"
      "ti/mas/vppu/ce66/vppu_c.ae66"
      "ti/mas/rcu/ce66/rcu_rfc355x_c.ae66"
      3) Replace TFTP-PUT with VPPU-TX for RTP processing
      In the current transcode example, siuVct_WriteOutputData() is called after the encoding to send the encoded output via TFTP. siuVct_WriteOutputData() then calls siuVctTftpPutData(), which then calls siu_put_tftp(). In order to support RTP processing, instead of calling siu_put_tftp(), vppuSendIn() should be used. 
      a) APIs for the VPPU component can be found in components\ti\mas\vppu\vppu.h. 
      b) vppuSendIn() use in sv01: dsp\siu\video\siuVigdkTxVideo.c siuTxVideoEncoderProcess() function.
      c) Call chanin from VPPU-TX: VPPU-TX --> RCU-TX --> NEU-TX. For comparion, the call chain with TFTP is: TFTP-TX-->NEU-TX.
      4) Create and open instances for VPPU and RCU 
      In order to use VPPU/RCU to support RTP processing, need to first ccreate and open their instances, similr to NEU has been used in video transcode example.
      a) Add VPPU/RCU instances and related variables in siuInst_t defined in dsp\siu\vct\src\siuVctLoc.h. 
      Reference in sv01: siuInst_t in dsp\siu\video\siuVigdkLoc.h, and below are some example instances:
      ...
      void *vppuInst;
      ...
      void  *rcuInst;
      ...
      b) Scan the funtion calls in dsp\siu\vct\src\siuVctInit.c for message processing, i.e., the for loop after "/* Execute messages */". If a function call is implemented in both dsp\siu\vct and another directory in dsp\siu, compare both implementations, and then modify/add the stuff needed for RTP processing (VPPU, RCU, and etc.). Using siuVideoMode() as the example, it's implemented in both dsp\siu\vct\src\siuVctInit.c and dsp\siu\video\siuVigdk.c. The following code may need to be added in dsp\siu\vct\src\siuVctInit.c for RTP processing:
      ...
      siu_new_vppu(chnum);
      siu_open_network (chnum, gg_vppu_ctable.vppuReceiveIn, inst->stateInst.video.vppuInst, TRUE);
      ...
      The above gives the basic idea of adding RTP processing in the transcode example. As we have not implemented it, there can be gaps. Please let us know if there are any difficulties.
      Thanks,
      Hongmei
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on May 10 2012 04:22 AM
      Intellectual975 points

      Hongmei, thanks for your quick reply.
      I want EVM6678L do a single channel with H.264 encoder and output bitstream via RTP/RTCP, and the VLC on PC could play it real-timely.
      In the future, JPEG/MJPEG codec maybe added.
      And no audio codec.
      The YUV data may come from PC via ethernet or from other board via SRIO.
      As you say, in the first it's OK to keep the decoder and use H264 clip as the input.

      In the mcsdk_vide, especially sv01, there're too many abbreviation without explanation. such as siu, vigdk, mgb, and so on.
      It's very difficulty to understand and modify.

      My questions are:
      1. Transcode demo + RTP output, then VLC on PC could open rtsp stream from C6678 ?
      2. How to use VPPU/RCU/NEU module? Is there any sample code?
      3. How could I accelerate the process of estimating and implementing this demo ?

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 10 2012 10:13 AM
      Verified Answer
      Verified by dp
      Intellectual2960 points

      Hi dp,

      You mentioned the requirement of "real-time" for your demo. Then, what is the resolution for H.264 encoding? Is it QCIF, CIF, D1, or HD? What is your target frame rate?

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on May 11 2012 05:39 AM
      Intellectual975 points

      Hi Hongmei,

      My demo is for evaluation, and my goal is H.264 encode 1080p at 15fps. 

      But at first, I need to get this demo done.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 14 2012 16:59 PM
      Intellectual2960 points

      Hi dp,

      1080p H264 encoding@15fps needs 2-3 cores for the encoding itself. Since the transcode example in CCS is a single-core demonstration, it may not be suitable for further developing your demo.

      Instead, a better starting point would be sv04: codec integration and test application (http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.0_CODEC_TEST_FW_User_Guide). sv04 supports mullti-core H.264BP encoding and also the mode of encoding only. Similar to the transcode example, it also uses TFTP for data I/O. Therefore, the steps 2)-4) for adding RTP support in our earlier reply are still applicable to sv04. sv04 is built with MinGW. After getting the sv04.out, it can be loaded in CCS and then debugged in the same way as a .out file from a CCS project.

      From sv04, the first step can be focusing on adding RTP for the encoded output while still using TFTP to get the YUV input. Then, the TFTP-GET can be replaced with a faster data input method.

      For your earlier questions: 1) RTP output can be played out via MPlayer on a PC, as demonstrated in MCSDK Video real-time demo (http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.0_Demo_Guide). VLC should work also. 2) NEU module has been integrated an used in both the transcode example and sv04. Sample code of VPPU and RCU can be found from sv01.

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on May 16 2012 00:57 AM
      Intellectual975 points

      Thanks Hongmei,

      My demo  will integrate other peripheral's driver ( such as srio, spi and so on) that are all ccs/bios based.  And I'm not familiar with MinGW-based-projects, and don't know how to modify or debug it.

      My questions are: 

      1. What's the difference between sv01 and sv04? What source files they include? How to add or modify codecs? why ti afford such MinGW-based-projects?

      2. Which demo should I start?  

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 18 2012 16:15 PM
      Intellectual2960 points

      Hi dp,

      sv01 is a full-fledged video demo which has such features as: 1) multiple C6678 video codecs (as seen @ dsp\vtk\codecs) are integrated, 2) supports multiple transcoding channels; 3) supports multiple resolutions from QCIF to 1080p; 4) supports three channel models: encode only, decode only, and transcode; 5) supports core-core transcoding and multi-core encoding/decoding; 6) demo runs in real-time.

      sv04 is developed for integrating and testing individual codecs with data IO via TFTP. It is single video channel, and each testing is for a single codec as configured in ...\dsp\siu\vct\tftp.cfg. Adding a codec to sv04 is straightforward as described in http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.0_CODEC_TEST_FW_User_Guide#Integrating_new_Codec_into_the_build. In MCSDK Video 2.0, H264BP encoder and H264HP decoder have been integrated in sv04, and can be used as is.

      For your use case of 1-channel 1080p H264 encoding, we would like to recommend starting with sv04. One way to identify the source files is making sv04 with "FLAT=YES". After the compilation is completed, you can get the list of files from what are included in dsp\mkrel\sv04\flat directory. 

      If a source file of sv04 is modified, you can just rerun the make command to rebuild sv04.out. sv04 make instructions can be found from http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.0_CODEC_TEST_FW_User_Guide#Make_Instructions. For sv04 debugging, as sv04.out is loaded through CCS, it can be debugged in the same way as a .out file from a CCS project.

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 22 2012 15:24 PM
      Intellectual2960 points

      Hi dp,

      We created a CCS project for sv04 as attached below. Please unzip it as ..\examples\sv04 directory and try it out. Detailed instructions can be found from <MCSDK video install diretory>\examples\sv04\Readme.txt.

      1881.sv04.zip

      Also please get the patch as described in http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/188748.aspx (3108.components.zip) if you saw the same issue as reported in the post.

      Hope this can help developing your demo. Please let us know if there are any issues.

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on May 28 2012 20:59 PM
      Intellectual975 points

      Hongmei,
      Thanks for your work.
      I followed the steps 2)-4) to add RTP support for sv04, but there isn't "Project Properties->C6000 Linker->File Search Path". I try to add to "Project Properties->C/C++ General->Path and Symbols->Libraries", but it build err.
      Could make sure of that?
      dp

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on May 29 2012 09:30 AM
      Intellectual2960 points

      Hi dp,

      Please find how to add libs (--library) from the screen capture attached below:

      4670.LinkLib.zip

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on Jun 05 2012 05:17 AM
      Intellectual975 points

      Hongmei, sorry to disturb u. 

      I've modified sv04_ccs following step2~4, but havn't compile success.

      "gg_rcu_ctable、vppuContext " are defined in ggvideocfg.c,  if I add ggvideocfg.c to sv04, siuVigdkLoc.h will be included, whichi is conflicted with siuVctLoc.h.

      Are there documents that describe the flow of sv01/sv04/RTP? 

      I'm not familiar with the flow of the program and just follow your instructions.

      what's the relations of siu_*** and vppu ? and also so many abbreviation without explaination, such as gg**, siu**, HDCT
      and  there are really difficulties.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on Jun 05 2012 17:44 PM
      Intellectual2960 points

      Hi dp,

      ggVideocfg.c and ggVideoCfg.h are used for sv01, while ggCodecTestCfg.c and ggCodecTestCfg.h are for sv04. So, instead of add ggVideocfg.c to sv04, we can add gg_rcu_ctable, vppuContext, and etc. in ggCodecTestCfg.*, similar to what have been included in ggVideocfg.* When making such addition to ggCodecTestCfg.* for sv04, further changes can be needed for the following sv04 files: dsp\ggcfg\build\hdg\sv04\ggswcfg.h; examples\sv04\source\ggmemdef.c; examples\sv04\include\ggmemmap.h; examples\sv04\linker.cmd. You can refer to their corresponding files in sv01 for the code changes needed: dsp\ggcfg\build\hdg\sv01: ggswcfg.h; ggmemdef.bec; ggmemmap.beh; ggvf0.becmd.

      Please try with the above changes to see if the compilation can go through.

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on Jun 06 2012 05:22 AM
      Intellectual975 points

      Hongmei,
      I have compared and modify \sv04\ggswcfg.h, and add gg_rcu_ctable, but it compile error
      Error: not define "gmpAllocGmc", "gmpFreeGmc", "siuRxVideoPost",
      I add siuVigdkCodecMgr.c to solve this error.
      what's the meaning of "Vigdk"?
      what's the file of *.beh *.bec? Do I need to add #define and MACRO from *.beh to ggmemmap.h?
      How to understand the flow quickly?
      Thanks.
      dp

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hongmei Gou
      Posted by Hongmei Gou
      on Jun 06 2012 16:11 PM
      Intellectual2960 points

      Hi dp,

      Since you are using only VPPU-Tx, you can replace gmpAllocGmc, gmpFreeGmc, and siuRxVideoPost with NULL in vppuContext after adding it in dsp\gg\ggCodecTestCfg.c. Those functions are used only by VPPU-Rx. Meanwhile, please remove siuVigdkCodecMgr.c from your project. *Vigdk files are for sv01.

      sv01 is a multi-core and multi-channel application. *.beh, *.bec, *.becmd files are parsed by Active Perl during the making process so that .c, .h, and .cmd files can be generated for multi-core and multi-channel use case. One example is shown as below. For the transcode and sv04 CCS projects, since there are at most two channels, we are directly using .c, .h, and .cmd files. 

      Example:

      In dsp\ggcfg\build\hdg\sv01\ggvf0.becmd:

      /*----------------------------------------------------------------------------*/
      /* foreach $ch in (1..NUMCH) expand */
      /*----------------------------------------------------------------------------*/
      DATA_CH$(ch) : origin = $(0xF0000000 + (($(ch)-1) * 0xB00)), length = 0xB00 /* Remember to change ggmemmap.beh */
      /* endfor $ch */

      dsp\mkrel\c64x\ggvf0.cmd which is generated when making sv01:

      /*----------------------------------------------------------------------------*/
      /* Expanding $ch = 1 */
      /*----------------------------------------------------------------------------*/
      DATA_CH1 : origin = 4026531840, length = 0xB00 /* Remember to change ggmemmap.beh */
      /* End expansion $ch = 1 */
      /* Expanding $ch = 2 */
      /*----------------------------------------------------------------------------*/
      DATA_CH2 : origin = 4026534656, length = 0xB00 /* Remember to change ggmemmap.beh */
      /* End expansion $ch = 2 */
      /* Expanding $ch = 3 */
      /*----------------------------------------------------------------------------*/
      DATA_CH3 : origin = 4026537472, length = 0xB00 /* Remember to change ggmemmap.beh */
      /* End expansion $ch = 3 */

      ......

      Thanks,

      Hongmei

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • dp
      Posted by dp
      on Jun 07 2012 06:31 AM
      Intellectual975 points

      Hi Hongmei, 

      I've re-modify the sv04 project step by step follow aforementioned instructions.

      The compile errors are snapshoted as follows: 

       Thanks.

       dp 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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