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.

How to send h.264 bit stream using rtp in vcrdk?

Hi,

I see the DEMO_VC_RTP_TX_RX demo in vcrdk,

when i read the function

static Int rtpTx_send(Void *pEncodeBuffer,Int32 frameSize,Int32 frameType)
{
    int sentlen = 0;
    
    sentlen = rtp_h264_send_stream(gRtpTx_config.rtpTxSession, pEncodeBuffer, frameSize, gRtpTx_config.rtpTxTimeStamp);    
    
    gRtpTx_config.rtpTxTimeStamp += 90000/gRtpTx_config.rtpTxFrameRate;        /* 90Khz rate fixed for h264 by rfc3984 FRAME_RATE = 30*/        
    if (sentlen == 0) {
            OSA_printf("RTPTX: In rtpTx_send: sentlen is 0 !!!!\n");
    }
    else {
        //OSA_printf("sentlen = %d\n",sentlen);
    }
    
    gRtpTx_config.total_bytes_sent += sentlen;
    gRtpTx_config.num_frames_sent++;

    if ((gRtpTx_config.num_frames_sent % 600) == 0) {
            OSA_printf("RTPTX: Frames Sent = %u. Total bytes sent = %u",gRtpTx_config.num_frames_sent, gRtpTx_config.total_bytes_sent);
            ortp_global_stats_display();
    }
            
    return 0;
}

There is no source for this function.

1) If i want to write my own project how to use it ?

should i include some libs or i have to rewrite by myself ?

2) If lib is supplied by ti ,in which folder?

3) the follow functions also have same problem

extern void * rtp_init_video_recv(int videoUdpPort,int audioUdpPort);
extern void * rtp_session_recvm_with_ts (void * session, int user_ts);
extern int rtp_session_parse_h264_mb2buf (void *mb, int *buff, int buflen, int *rx_observed_markbit);
extern int rtp_session_wait_for_rxpkt (void *s);



  • Hi Xavier,

    1)No source provided for RTP stack in vc-rdk release package. oRTP can be downloaded from http://download.savannah.gnu.org/releases/linphone/ortp/sources/

    TI has added rtp_h264_send_stream(), rtp_session_parse_h264_mb2buf() functions to create and parse H264 RTP payloads in RTP stack. You can download RTP stack from above link and add for your requirements.

    2)Only ortp library has been provided with vc_rdk release package in /ti_tools/rtp_lib directory.

    3)Yes these functions are from rtp stack.

    Ram

  • Hi Ram,

    In rtp_h264_send_stream(), rtp_session_parse_h264_mb2buf() funs,

    I think just create and parse H264 RTP payloads in RTP stack,

    why it is not supplied in the vcrdk, it seems a standard algs, and rtp stack is inside?

    because i am not very familiar with the rtp , how is the rtp send and receive come out,

    I think some function in rtp_lib is called, am right?

  • Hi Ram

    I have download the ortp lib from web address you say.

    Could you tell me how to build it to use on dm8168 platform then:

    I have follow 3 steps:

    1)./configure --host= arm-linux

    or ./configure --prefix=/opt/ortp --host= arm-linux --disable-staticCC=arm-none-linux-gnueabi-gcc

    2) make

    3) make install

    Does the first step right?

    After compiled, how i place the include file and the lib file if i want to use it on dm8168?

    \usr\include and \usr\lib

    Is there any other works to do?

    Best regards

    xavier

  • Hi Xavier,

    for the first step I added the path to the arm cross compiler to PATH (export PATH=$PATH:/somewhere/arm-2009q1/bin) and called ./configure this way:

    ./configure --target=arm-none-linux-gnueabi --host=arm-none-linux-gnueabi --prefix `pwd`/install

    But if 1) worked for you, so what...

    For building the software using ortp I just have added within the makefiles the include and library path into my ortp 'install' directory,, and of course copied the dynamic library files from there into /usr/lib within the root files system of the target platform.

    Regards,
    Joern.

  • Hi Joern

    Thank you for your reply!

    Today i try the step , it does not ok .And i write in follow ways

    ./configure --prefix=/opt/ortp --host=i386-pc-linux --target=arm-none-linux-gnueabi --disable-static  CC=arm-none-linux-gnueabi-gcc

    it works, and i see you --host is arm-none-linux, and i also othe pepole fill with the target tyep,

    what dose host mean, is not the pc that does cross compile  ?

    Best regards

    xavier

  • Hi Xavier,

    around that ever and ever I myself am confused, I simply don't get in my mind. A good answer to that question f.e. is here to be found.

    In principle --host defines on which system the builded code shall run, --target defines for which target system eventually also builded toolchain components (like gcc) shall compile, and --build defines the system on which the configured build shall be done.

    So you might configure on a system a) a project which then will be built on system b) (given by --build) and generates a toolchain which shall run on system c) (given by --host) and which shall there genereate code for a system d) (given by --target).

    So the --target option for just compiling ortp seems unneeded, but I never tested that. Also I made the experience, that not all configure scripts are supporting all possible options and not all those scripts do that the same, correct way. So sometimes some testing or digging into the scripts is needed...

    That --host=i386-pc-linux works for you I'm wondering about - aren't you compiling ortp for the ARM platform?

    Kind regards,
    Joern.

  • Hi Ram 

    I using ortp lib to send h264 video stream, get from dm8168,

    use vlc on windows xp to play,  And now the video seems not  very consequent,and time delay is significantly

    It seems something wrong with ortp using,could you give me some help to find this problem?

    my frame size is 720x576, how long it will delay to send bitstream of PAL normally?

    best

    regards

  • Hi Xavier,

    RTP for h264 payload is always sent one NAL unit at a time. If NAL size is > 1400 bytes, it will be split into multiple packets and sent. For the last payload sent, rtp sessions inserts a mark bit to indicate last payload. So far any video payload size matters.

    RTP receive sesssion receives all the payloads and will keep checking for mark bit in the session. Once it gets the mark bit(complete frame is received now), it exists and feeds the accumulated payload buffer to decoder.

    Delay introduced by RTP will be negligible always.

    What is the delay observed(in terms of milli seconds) compared to vlc?

    Ram

     

  • Hi Ram

    it seems more than 3s delay from capture to vlc decoder display ,

    i split the NAL unit and in ortp i do not find function to set  a mark bit, does it really mater if mark bit unsetted,

    now my video play for a while and it blocked then it plays normally ok,

    this period happens,

    i have two questions :

    1) how to set the time sample ,it seems effect a lot on video decoder display , does not it follows encoder time sample in dvrrdk?

    2) how to set mask bit in ortp lib ,should changed lib code ?

    xavier

  • Hi Ram

    i using ortp libs on dm8168 evm board,

    and it always printf  " ortp-warning-Must catchup 59 miliseconds ",

    Is that means ortp can not send on time as the dm8168 is busy ,and send task is delayed ?

    how to solve this problem , do i need to rise  send task priorty ?

    best regards

    xavier