[Libav-user] possible AVFilterGraph bug: code, work around, and video triggering issue

Blake Senftner bsenftner at earthlink.net
Tue Jan 24 03:16:13 EET 2017


Hello Libav-Users,

I have been developing a libav based video playback library for use at a computer vision company. We’re developing with ffmpeg 3.2.2 based libav dlls, downloaded pre-built from the Zerano.com <http://zerano.com/> website. The goal is a library for playback of any media ffplay can play. We primarily work on Windows, but we deploy in both Windows and Linux. For research of libav usage, ffplay is step-wise traced in GDB quite a bit to figure out how things are handled. 

I believe there may be a bug in the conversion from YUV to RGBA for some cases of WMV and AVI format videos. 

I suspect this issue has been able to persist because the ffmpeg sources use SDL for video display; that code uses SDL's YUV frame buffer, effectively hiding this RGBA conversion issue. 

First a test video: https://www.dropbox.com/s/x1etodcsg55o0gc/M001.avi?dl=0 <https://www.dropbox.com/s/x1etodcsg55o0gc/M001.avi?dl=0>

The above link is to an AVI video that crashes ffplay on Windows, but plays fine with ffplay on ubuntu. The above linked video plays fine in our libav based video playback library on Windows, traveling down the “incorrect pixel format conversion” catching logic. I have other WMV format videos that display fine in ffplay, but when requesting an RGBA pixel format in our code requires the format conversion correction described below to display correctly. 

Here is a link to a C++ source file containing:
1) a C++ class implementing a bare bones AVFilterGraph
2) the logic that uses the C++ class wrapping around the AVFilterGraph, which also catches and corrects for bad format conversions.

	https://www.dropbox.com/s/yrzgtdxk3bo6s9m/CE_Libav_framefiltering.h?dl=0 <https://www.dropbox.com/s/yrzgtdxk3bo6s9m/CE_Libav_framefiltering.h?dl=0>

The incorrect format conversion is generating image rows that are 2 pixels (8 bytes) too long. 

Unfortunately, I am unable to post more code. In the source code I describe how the AVFilterGraph is used, and how the AVFrame used comes from avcodec_receive_frame().

If this is not a bug, but known and expected behavior, is my work-around the preferred work-around? 

While trying to track down if anyone else has posted about this issue, I located a discontinued project in Spanish with comments describing issues with YUV to RGBA conversion. They tried fixing their conversion issue with use of the “yadif” video filter... but the project appears discontinued, so I don’t know what happened there… 

Any information related to this issue is welcome. Please let me know if you’ve encountered this issue and what did you do? My existing work around “works”, but should be unnecessary…

-Blake Senftner 
Sr. Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20170123/45b497d2/attachment.html>


More information about the Libav-user mailing list