如题

解决方案 »

  1.   

    贴图弄个GIF 就像网站视频缓冲的那个一样。。
      

  2.   

    我不清楚你怎么弄的
    我以前用的ffmpeg来做的,directshow我觉得开发过程应该都差不多
    我以前做法是,来了视频数据,先找关键帧,只有收到关键帧,才开始把帧放入解码器进行解码。不过没收到,就保持视频窗口原状。
    你黑屏的产生是不是,不管第一个视频帧是那种类型的帧,都往解码器丢,所产生的啊。
      

  3.   

    directshow,怎么判断是不是关键帧呢?
      

  4.   

    不是考directshow来判断,这个判断由你自己写
    我以h264为例子,下面是找关键帧的函数,我们工程定义,关键帧,帧头以 00 00 00 01 67开头:
    /*the return value is the head offset*/
    int Ch264decode::findheader(unsigned char* databuf, int len)
    {
    int offset = 0;
    for(; offset< len -4; offset++,databuf++)
    {
    if(databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x00 && databuf[3] == 0x01 && databuf[4] == 0x67)
    {
    m_frametype = H264_STP_A;
    m_isIframe = TRUE;
    return offset;
    }
    }
    m_frametype = H264_NONE;
    if(FALSE == m_isIframe)
    return len;
    return 0;
    }
      

  5.   

    你下的东西是 h264编码 还是mpeg4编码 或者是其他什么,你总知道撒
    知道了,就自己查RFC一般头字段都会有说明,然后你就可以接了
    如果下的是其他公司私有格式,那抱歉,你是接不出来的
      

  6.   

    我只看过h264和mpeg4,你自己查查你的视频格式啊。
      

  7.   

    我的就是mpeg4啊,
    你能留个邮箱不?
    或者QQ
      

  8.   

    int findheader_h264(char* databuf, int len)
    {
    int offset = 0;
    int frametype;
    for(; offset< len -4; offset++,databuf++)
    {
    if(databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x00 && databuf[3] == 0x01 && databuf[4] == 0x65)
    {
    frametype = H264_I;
    return frametype;
    }
    else if(databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x00 && databuf[3] == 0x01 && databuf[4] == 0x67)
    {
    frametype = H264_STP_A;
    return frametype;
    }
    }
    frametype = H264_NONE;
    return frametype;
    }int findvol_mpeg4(char* databuf,int len)
    {
    int offset = 0;
    int frametype;
    for(; offset< len -4; offset++,databuf++)
    {

    if(databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x01 && databuf[3] == 0x00)
    {
    frametype = MPEG_IFRAME;
    return frametype;
    }
    else if( (databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x01 && databuf[3] == 0xb0)
    || (databuf[0] == 0x00 && databuf[1] == 0x00 && databuf[2] == 0x01 && databuf[3] == 0xb6) )
    {
    frametype = MPEG_PFRAME;
    return frametype;
    }
    }
    frametype = MPEG_NONE;
    return frametype;
    }
      

  9.   

    参数databuf是什么,是一个Sample吗?