<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi a l ,thanks for you support.<div>I have problem with decoding frames.</div><div> </div><div>I am trying to save frames in a h264 stream to .PPM file.I am trying to decode a 00:00:02.08 sec video with "<b>24fps" .</b></div><div> </div><div>Problem: problem is that I could only decode 46 frames from the video .I wounder where are those 2 frames missing.</div><div>Here is the snapshot of the code</div><div><br></div><div><div>while (av_read_frame(pFormatCtx, &packet) >= 0)</div><div> {</div><div> // Is this a packet from the video stream?</div><div> if (packet.stream_index == videoStream)</div><div> {</div><div> // Decode video frame</div><div> avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);</div><div><br></div><div> // Did we get a video frame?</div><div> if (frameFinished)</div><div> {</div><div> </div><div><span style="font-size: 10pt; "> // Save the frame to disk</span></div><div><span style="font-size: 10pt; "> SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, ++framecount);</span></div><div><span style="font-size: 10pt; "> }</span></div><div> }</div><div><br></div><div> // Free the packet that was allocated by av_read_frame</div><div> av_free_packet(&packet);</div><div> }</div></div><div><br></div><div>Here is the complete code :<a href="http://pastebin.com/3qsGrrCU" style="font-size: 10pt; ">http://pastebin.com/3qsGrrCU</a></div><div><br></div><div>Can some one please help me in this aspect .</div><div><br></div><div><br></div><div>Thanks in advance.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div> </div></body>
</html>