Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (avformat_seek_file(pFormatCtx, videoStream, INT64_MIN, (int64_t)(pFormatCtx->duration * percent), INT64_MAX, 0) < 0) {
- //avcodec_flush_buffers(pCodecCtx); // tried with and without this, not sure if it's needed
- while(av_read_frame(pFormatCtx, &packet)>=0) {
- // Is this a packet from the video stream?
- if(packet.stream_index==videoStream)
- // Decode video frame
- avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
- // ...
- SaveFrame();...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement