Advertisement
Guest User

Untitled

a guest
Sep 19th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. if (avformat_seek_file(pFormatCtx, videoStream, INT64_MIN, (int64_t)(pFormatCtx->duration * percent), INT64_MAX, 0) < 0) {
  2. //avcodec_flush_buffers(pCodecCtx); // tried with and without this, not sure if it's needed
  3. while(av_read_frame(pFormatCtx, &packet)>=0) {
  4. // Is this a packet from the video stream?
  5. if(packet.stream_index==videoStream)
  6. // Decode video frame
  7. avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
  8. // ...
  9. SaveFrame();...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement