H.264 Encoder and RTP

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\"  ?

  • In reply to Hongmei Gou:

    Hi dp,
    Attached below please the patch for adding RTP processing in the SV04 CCS project. Please unzip sv04.zip as ..\examples\sv04 directory and dsp.zip as ..\dsp directory, and try it out.
    A few notes:
    1) tftp.cfg and multiclip.cfg are copied to examples\sv04\source directory, and therefore examples\sv04\Debug\sv04.out can be directly loaded and run without copying back to dsp\mkrel\sv04\flat. Please modify examples\sv04\source\tftp.cfg & multiclip.cfg for your setup and clip configuration.
    2) Code changes are made for supporting testing of H264BP encoder @ various resolutions: QCIF, CIF, D1, 720p, and 1080p without rebuilding sv04.out. In tftp.cfg, we can specify corresponding encResolution: 1080p, 720p, or non-HD. Then, after loading sv04.out, the following parameters can be changed in Watch window to configure resolution, frame rate, and bit rate: image_height; image_width; frame_rate; intra_frame_interval; bit_rate. These parameters are globals defined in dsp\siu\vct\codec\encoder\h264\vctH264EncClient.c.
    3) Several parameters can be adjusted according to your application, including 
    a) In dsp\siu\vct\src\siuVctVppu.c, frameRate is set to 15 using a global variable. It is used for calculating the increment of timestamp for frames.
    b) In dsp\siu\vct\src\SiuVctInit.c, VPPU config parameters are set in siuCommitState(), such as codingType, txInitTimeStamp, and inputStreamFormat
    c) In dsp\siu\vct\src\siuVctInit.c: TxSyncSrc is set to 0x00000064, and txInitTimeStamp is set to 0 using global variables.
    4) Verification: input data is from TFTP_GET as in the original sv04; encoded output is sent out as RTP packets through VPPU-RCU-NEU. The sent-out RTP packets can be captured via Wireshark. One example capture is attached below. To avoid RTP packet loss, especially for HD clips, please use Giga bit network card on your testing PC.
    The code changes can be found from diff of the baseline and the patch. Hope this can help develop your demo and add additional modules. Please let us know if there are any problems.
    Thanks,
    Hongmei
  • In reply to Hongmei Gou:

    Thanks Hongmei,

    The demo could send rtp, but when I use vlc to receive rtp, vlc display in a mess.

    I use vlc to open sdp file as belows:

    m=video 32770 RTP/AVP 96
    a=rtpmap:96 H264
    a=framerate:15
    c=IN IP4 192.168.42.49 

     And more, could vlc receive rtp via url instead of sdp file ?

     

    dp 

  • In reply to dp:

    dp,

    VLC typically has problem receiving H264 RTP stream (without additional hinting via container mov/avi/ts etc). VLC can however decode other codecs properly. Please use mplayer to receive the stream. You can invoke command line as mplayer sdp://sdpfile.sdp -fps 30

    Regards,

    Vivek

  • In reply to Vivek Chengalvala:

    Hi dp,

    Using MPlayer as Vivek suggested, we verified QCIF playout with the attached batch file and sdp file. Please modify them accordingly to test with your setup. When testing with different resolutions, the last line of the sdp file such as "sprop-parameter-sets" needs to be set correspondingly. Some reference sdp files can be found from MCDSK Video release: demos\demoroot\Reference\config\demo1\sdp: for CIF & QCIF

    demos\demoroot\Reference\config\demo2\sdp: for 1080p

    0218.H264Play.zip

    Thanks,

    Hongmei

  • In reply to Hongmei Gou:

    Hi Hongmei & Vivek,

    Following your instructions, mplayer could get and play RTP at 1920x1088 well. However, still some questions:
    1.how to calc the fps at the pc side ?
    2.Since the frame_rate is determined by encoder power of core, what's meaning of the frame_rate which is defined in vctH264EncClient.c ?
    3.when use multicore(such as 4 cores, in tftp.cfg) to do H.264 encoder, mplayer display mess, what's wrong ?

    Thanks.

    dp

  • In reply to dp:

    Hi dp,

    There are several factors for the frame rate the system can achieve:

    1) Frame rate of the input (determined by the SRIO throughput in your case)

    2) Cycle performance of the codec and the CPU clock (H264BP encoder is a multi-core codec, and the desired FPS for a particular resolution, e.g. 1080p@30fps, can be achieve by using multiple cores as needed)

    frame_rate in vctH264EncClinet.c is applied to two dynamic parameters of the codec: refFrameRate and targetFrameRate. Along with another dynamic parameter targetBitRate, they are used for rate control inside the encoder.

    So, if the target frame rate of a system is 1080p@15fps, we need to have: 1) 1080p input is coming at 15fp; 2) frame_rate in vctH264EncClinet.c is configured as 15fps; 3) 2-3 cores used for the encoding; 4) frameRate in siuVctVppuPutData() is set as 15fps to get the corresponding timestamp increment.

    For issue #3 with multicore testing, please make the following change in siuVctEncode_xdm0p9.c to resolve it:

    Currently master core calls siuVct_WriteOutputData() multiple times (one per core) to send the output data. Instead of this, master core shall assemble the output data from Core 0 to Core N in a big buffer, and then call siuVct_WriteOutputData() just once to send out the assembled output data for the frame.

    Thanks,

    Hongmei

  • In reply to Hongmei Gou:

    Hongmei,

    Thanks for all your help. Without you, we move tardily.

    Regards,

    dp

      

  • In reply to dp:

    hi, dp.

    I also met the same problem. I want to add AVS in this project. 

    just like you, I hope create a project not use minGw, can you give me some advice?

    thank you

  • In reply to Hongmei Gou:

    Hi,Hongmei:

    I download the sv04  ccs project which you supply in the attached files .But when I

    compiled errors come like below:

    js: "C:/ti/framework_components_3_22_00_05/fctools/packages/xdc/runtime/System.xs", line 52: xdc.services.global.XDCException: xdc.cfg.USE_MODULE_PARAMETER_ERROR: The first parameter of an xdc.useModule() call must be a string
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/xdcruntime/Settings.xs", line 93
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/BIOS.xs", line 247
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/family/c64p/Hwi.xs", line 97
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/hal/Hwi.xs", line 59
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/family/c66/Cache.xs", line 248
        "C:/ti/bios_6_32_05_54/packages/ti/sysbios/hal/Cache.xs", line 53
        "C:/ti/framework_components_3_22_00_05/packages/ti/sdo/fc/memutils/package.xs", line 93
    gmake.exe: *** [package/cfg/sv04_pe66.xdl] Error 1
    js: "C:/ti/xdctools_3_25_02_70/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake: *** [configPkg/compiler.opt] Error 1
    gmake: Target `all' not remade because of errors.

    I think I set correctly like below settings ,I don't know where make mistake my ccs version is CCS5.4.1

  • In reply to David George:

    Hi David,

    MCSDK Video uses lite package of Framework Components (without fctools directory), and picks up XDAIS, EDMA3LLD, XDC from their own installers. Can you please try renaming or removing fctools under your FC installation directory (e.g., C:/ti/framework_components_3_22_00_05), and then clean and rebuild the project?

    Thanks,

    Hongmei