[Live-devel] Regarding the sps/pps in live555

梦幻工作室 fantasyvideo at 126.com
Sun Oct 13 19:52:44 PDT 2013


 HI ,
     I use live555 to setup one rtsp server which provides h264 stream.
     In the GetNextVideoFrame I use the following code.
void  RecorderSession::GetNextVideoFrame(bool first,char* to,
                                unsigned int maxsize,
                                unsigned int *framesize,
                                unsigned int* fNumTruncatedBytes)
{
    int size = 0;
        static char startcode[]={0x00,0x00,0x00,0x01};
        if(first)
        {
            memcpy(to,startcode,4);
            memcpy(to+4,sps.buf,sps.len);

              memcpy(to+sps.len+4,startcode,4);
            memcpy(to+8+sps.len,pps.buf,pps.len);

            size = pps.len+8+sps.len;

        }
    unsigned int len = 0;
    _videoqueue->Get(to+size,&len);
    *framesize = len +size;
    if(*framesize>maxsize)
    {
        *fNumTruncatedBytes = (*framesize)-maxsize;
    }
}
As you see, when the first request comes, I fill the sps/pps info to it.
But when I use vlc to play it, it also said it's waiting sps/pps.
Could you give me some suggestion about it? THKS.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20131014/e18d90fd/attachment.html>


More information about the live-devel mailing list