Deinterlacing in ffmpeg

I followed the tutorial here to upload video files to a C program. But frames are not deinterlaced.

From what I saw, the ffmpeg executable supports the -deinterlace switch. How to do this in code? What library / features should I read about?

+3
source share
1 answer

You need to manually call avpicture_deinterlaceto deinterlace each decoded frame. The definition of a function can be found here . Basically it will look (using the variables from the first page of the tutorial):

avcodec_decode_video(pCodecCtx, pFrame, &frameFinished,
                     packet.data, packet.size);

if(frameFinished) {
    avpicture_deinterlace((AVPicture*)pDiFrame, 
                          (const AVPicture*)pFrame, 
                          pCodecCtx->pix_fmt, 
                          width, 
                          height);
     . 
     . 
     .
 }

, pDiFrame , pFrameRGB , avcodec_alloc_frame avpicture_fill, : (pCodecCtx->pix_fmt), 24- RGB.

​​RGB, .

+5

Source: https://habr.com/ru/post/1774537/


All Articles