This seems to be neccessary after recent changes to new APIs.
I now get thumbnails for MKVs and what not.
Supposedly it is auto-detected but documentation says
either avcodec_register() or avcodec_register_all() must be called before any other libavcodec functions.
av_register_all() internally calls avcodec_register_all(). It also makes sure it is only initialized once, not everytime this is called.
Perhaps someone more knowledgable in ffmpeg can chime in?
As a side note for a discussion happening on IRC, what I think should be done for MKV is to first try mkvinfo (check if it's there) + mkvextract attachments foo.mkv poster.jpg. Well ripped (or fixed with a kodi script) have the thumbnail and artwork built in. The test00.cpp in libmatroska seem to show how to do it with their API. Maybe in this case a shell script would be preferred.