Advertisement
Guest User

Untitled

a guest
Feb 14th, 2014
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. while (av_read_frame (context, &packet) >=0)
  2. {
  3. if(packet.stream_index == videoStreamIndex ) {
  4. avcodec_decode_video2 (pCodecCtx, pFrame, &finished, &packet);
  5. AVRational fr = av_guess_frame_rate(context, video_stream, pFrame);
  6. LOGD(" Frame RAte = %d/%d ", fr.num, fr.den);
  7.  
  8. if ( finished) {
  9. double pts;
  10. pts = av_q2d(pCodecCtx->time_base) * pFrame->pts;
  11. LOGD (" Received Frame of type %c pts is %ld pts %f " , av_get_picture_type_char(pFrame->pict_type), pFrame->pts);
  12.  
  13. } // Received Complete Frame..
  14.  
  15. } // Video Stream Index.
  16.  
  17. //av_free_packet (&packet);
  18. } // While
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement