Logic code is as follows:
While (1)
{
If ((ret=ffmpeg. Av_read_frame (m_pVidFmtCtx dec_pkt))==0)
{
Ret=ffmpeg. Avcodec_send_packet (m_pVidFmtCtx - & gt; Streams [dec_pkt - & gt; stream_index] - & gt; The codec, dec_pkt);
While (ret & gt;=0)
{
Ret=ffmpeg. Avcodec_receive_frame (m_pVidFmtCtx - & gt; Streams [dec_pkt - & gt; stream_index] - & gt; The codec, pframe);
Ffmpeg. Sws_scale (img_rgb_ctx pframe - & gt; Data, pframe - & gt; Linesize, 0, cy, dstData, dstLinesize);
Var bitmap=new bitmap (, dstWidth, dstHeight dstLinesize [0], PixelFormat. Format24bppRgb, convertedFrameBufferPtr);
}
}
}