Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- // Did we get a video frame?
- if (frameFinished)
- {
- // Convert the image from its native format to RGB
- sws_scale(sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
- if (ThisIsAFrameIWant(pFrameRGB))
- {
- WRITE FRAME TO NEW MPEG KEEPING AUDIO IN SYNC
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment