Created
November 17, 2012 23:57
-
-
Save sobotka/4101679 to your computer and use it in GitHub Desktop.
The Basic FFMPEG Decoding Loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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