Some people have asked me for my code to make the SMPTE VC-1 reference decoder work with FFmpeg,
slow though it may be. I suppose I could make a patch. But the official
version of FFmpeg is whatever happens to be in CVS at the current
moment. So any patch I could produce would work for maybe a day. So get
ready to do a little editing on your local FFmpeg CVS tree. The steps:
procure the VC1_reference_decoder_release6.zip file from the main site and unzip the tree somewherehave a copy of FFmpeg’s CVS tree handy; the rest of these instructions will assume that you are sitting in the root of the FFmpeg treecreate a directory called libavcodec/libvc1copy all of the *.c and *.h files from VC1_reference_decoder_release6/decoder/ into libavcodec/libvc1/copy all of the *.c and *.h files from VC1_reference_decoder_release6/shared/ into libavcodec/libvc1/place the libvc1-makefile.txt into libavcodec/libvc1/Makefilechange directory into libavcodec/libvc1 and type ‘make’change directory back to the FFmpeg rootplace the smpte-vc1.c file into libavcodec/edit libavcodec/vc9.c, go the very end of the file, and add #if
0/#endif around the wmv3_decoder AVCodec structure; this will keep it
from conflicting with the new SMPTE WMV3 decoder
edit libavcodec/Makefile and add smpte-vc1.o to the end of the OBJS listedit the top-level Makefile and add “-L./libavcodec/libvc1 -lvc1″ (without the quotes) to FFLIBSrun ‘./configure’ at the top level if you have not already done so for this treerun ‘make’ at the top level
That should be all there is to it. If FFmpeg declines to acknowledge
the ability to decode WMV3 data run ‘./ffmpeg -formats | grep wmv3′ and
make sure you see (after the versioning info): ” D V wmv3″.
Remember, the performance of the SMPTE VC-1 decoder is, as they say,
“nothing to write home about”. It’s dog slow. It’s not meant to be
fast. And it will not be optimized. Ever. Eventually, we will create
our own decoder that leverages optimized VLC decoding functions,
transforms, filters, etc. But in the meantime, if you want to
experiment with the reference decoder, this should work for you.
Update, Feb-16-2006: Thanks to Richard Goodwin
for pointing out step 12.5: edit libavcodec/allcodecs and remove the
comment blocks around “register_avcodec(&wmv3_decoder);”. Sometime
between the original post and now, this was commented out due to the
fact that the native WMV3 decoder is not classified as “working” yet.
Psssst… Do you need a copy of vc1_reference_decoder_release6.zip? Try here. Remember– slow as all get out. If you’re going to use it, may it be for the purpose of creating a free and fast implementation.
|