daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jan 19th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while (av_read_frame(pFormatCtx, &packet) >= 0)
  2.     {
  3.         // Is this a packet from the video stream?
  4.         if (packet.stream_index == videoStream)
  5.         {
  6.             // Decode video frame
  7.             avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
  8.  
  9.             // Did we get a video frame?
  10.             if (frameFinished)
  11.             {
  12.                 // Convert the image from its native format to RGB
  13.                 sws_scale(sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
  14.                 if (ThisIsAFrameIWant(pFrameRGB))
  15.                 {
  16.                     WRITE FRAME TO NEW MPEG KEEPING AUDIO IN SYNC
  17.                 }
  18.             }
  19.         }
  20.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top