Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- avcodec_decode_video2(codecCtx, frame, &frameFinished, &pkt);
- if(frameFinished){
- //(pFrame->data[0]+y*pFrame->linesize[0], 1, pFrame->linesize[0], pFile);
- struct SwsContext* convertCtx;
- //This can be improved significantly
- convertCtx = sws_getContext(codecCtx->width, codecCtx->height, codecCtx->pix_fmt,
- 32, 18, AV_PIX_FMT_RGB32, 0, 0, 0, 0);
- size_t allocSize = av_image_get_buffer_size(codecCtx->pix_fmt, codecCtx->width, codecCtx->height, 4);
- uint8_t *outData[1];
- outData[0] = (uint8_t*) malloc(allocSize);
- int outLinesize;
- sws_scale(convertCtx, frame->data, frame->linesize, 0, 18, outData, &outLinesize);
- sws_freeContext(convertCtx);
- FramesIn.push(outData[1]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement