Skip to content

Instantly share code, notes, and snippets.

@sobotka
Created November 17, 2012 23:57
Show Gist options
  • Save sobotka/4101679 to your computer and use it in GitHub Desktop.
Save sobotka/4101679 to your computer and use it in GitHub Desktop.
The Basic FFMPEG Decoding Loop
int gotFrame = 0;
while (av_read_frame(pFormatCtx, &packet) == 0)
{
if (packet.stream_index == myVideoStream)
{
avcodec_decode_video2(pCodecCtx, pFrame, &gotFrame, &packet);
if (gotFrame)
{
// Do something here.
}
}
av_free_packet(&m_packet);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment