FFmpeg bug testing
this document will try to explain the process used by bugtesters and developers to find and fix bugs in ffmpeg.
the process could be used in the future to automate bug testing. or find holes in our FATE coverage.
example 1 - bug 2414 - wmv2 decoding artifacts
- sample: http://samples.ffmpeg.org/asf-wmv/wmv2decerror-short.asf
- check if the official decoder/program handles the sample. it could be a broken file.
- mplayer -vc wmvdmo sample
- test sample with latest ffplay/ffmpeg.
- sometimes its already fixed.
- make sure its not an ffplay-only bug by also testing with ffmpeg.
- check with old version of ffmpeg to see if it is a regression bug.
- check if its a demuxer problem by testing with the ffmpeg/mplayer demuxer and official decoder.
- to test ffmpeg demuxer - mplayer -demuxer lavf -vc wmvdmo
- to test mplayer demuxer - mplayer -demuxer asf -vc wmvdmo
now that we know its not a demuxer problem, we can move onto debugging the decoder.
advanced codec debugging
- test if codec cpu optimizations are not binary identical to the c-version of the codec
- use ffmpeg -cpuflags 0 , ffmpeg has to be compiled with runtime cpu detection for this to work.
- test if codec asm version is not binary identical to the c-version of the codec
- recompile ffmpeg with --disable-asm
since codec also reports "dc overflow" error, check what the decoder does when it encounters this error. it is ffmpeg policy to report these errors, but also to continue decoding, in an effort to play as much of a file as possible.
in this case, msmpeg4dec.c , when encountering a dc overflow error, would return -1.
- try commenting out this in the source code, recompile, and test your changes to see if the picture changes for the better.
results and conclusion
there seems to be no way to switch asm optimizations on or off at runtime. its useful to have a seperate ffmpeg binary compiled with --disable-asm to test with.
required programs for bug testing
bug testers should have the following installed:
- latest git ffmpeg binary with asm and cpu runtime detection enabled
- latest git ffmpeg binary with --disable-asm and cpu runtime detection
- older version ffmpeg binaries with and without asm
- official 3rd party players
- windows media player
- mplayer version with binary codec support