[Libav-user] Analyzing frames WITHOUT deinterlacing.

David Harrison dosirrah at gmail.com
Wed Jun 29 04:39:31 CEST 2016


I have been handed a tool that analyzes frames along with its source code.
The tool uses libav.

In some cases the video input to this tool is interlaced.   The tool
operates just fine, but because my intent is not to render the video but to
extract and analyze features from the video I would prefer to analyze the
video in a lossless manner.  In other words, I DO NOT want to deinterlace
the video.  I would rather operate on half fields.  How would I do this?

I don't see anything specific in the source code related to deinterlacing.

  bool VideoReader::getNextFrame(AVFrame *pFrame) {
    ...
    while( (ret = av_read_frame(pFormatCtx, &packet)) >=0) {
        if(packet.stream_index == videoStreamIndex) {
            // Decode video frame
            avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished,
&packet);

            // Did we get a video frame?
            if(frameFinished) {
                // no calls to av
                ...
                av_free_packet(&packet);
                return true;
            }
        }

        // Free the packet that was allocated by av_read_frame
        av_free_packet(&packet);
    }

It appears that the deinterlacing happens auto-magically.

--Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160628/e8913017/attachment.html>


More information about the Libav-user mailing list