解决方案 »

  1.   

    自己找到问题了,但还是效果不理想,还是有点花屏
    sws_getContext ( pCodecCtx.width, pCodecCtx.height, pCodecCtx.pix_fmt,pCodecCtx.width, pCodecCtx.height, PIX_FMT_RGB32, SWS_BICUBIC, nil, nil, nil  );这句要改为sws_getContext ( pCodecCtx.width, pCodecCtx.height, pCodecCtx.pix_fmt,                                pCodecCtx.width, pCodecCtx.height, PIX_FMT_YUV420P, SWS_BICUBIC, nil, nil, nil  );
      

  2.   

    做播放器,现在用的方案是FFMPEG+SDL,图像出来了,但是花屏了一部分,静态图像正常,主要是动态图像显示花掉了
      

  3.   

    我也采用的是这样的方式,花屏的话除了自己找到问题了,但还是效果不理想,还是有点花屏
    sws_getContext ( pCodecCtx.width, pCodecCtx.height, pCodecCtx.pix_fmt,pCodecCtx.width, pCodecCtx.height, PIX_FMT_RGB32, SWS_BICUBIC, nil, nil, nil  );这句要改为sws_getContext ( pCodecCtx.width, pCodecCtx.height, pCodecCtx.pix_fmt,                                pCodecCtx.width, pCodecCtx.height, PIX_FMT_YUV420P, SWS_BICUBIC, nil, nil, nil  );还有你用的ffmpeg是哪个版本的?我换成最新的版本就没有花屏的出现了
      

  4.   

    先贴下你的ffmpeg版本,SDL是可以直接显示yuv数据的,去找一个能显示的YUV数据,
    再用楼主显示YUV数据的处理方式看看,
    看了下楼主的显示处理,感觉是你的UV分量处理有问题,
    mem_copy( PUInt8(pFrameRGB.data[1]), plane^, pCodecCtx.width div 4, pitch^, pCodecCtx.height div 4 ); //copy           
    inc( pitch );           
    inc( plane );           
    mem_copy( PUInt8(pFrameRGB.data[2]), plane^, pCodecCtx.width div 4, pitch^, pCodecCtx.height