Register all codecs and muxers before trying to generate thumbnail
ClosedPublic

Authored by broulik on Feb 5 2019, 10:23 AM.

Details

Summary

This seems to be neccessary after recent changes to new APIs.

Test Plan

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?

Diff Detail

Repository
R343 FFmpeg Thumbnailers
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik requested review of this revision.Feb 5 2019, 10:23 AM
broulik created this revision.
broulik edited reviewers, added: fvogt, yurchor; removed: Plasma.Feb 5 2019, 10:34 AM
broulik edited the summary of this revision. (Show Details)Feb 5 2019, 11:22 AM
broulik edited the test plan for this revision. (Show Details)
broulik added a reviewer: sandsmark.
yurchor accepted this revision.Feb 5 2019, 11:28 AM

Works fine for me locally (avi, mp4, webm, and mkv). Thanks.

This revision is now accepted and ready to land.Feb 5 2019, 11:28 AM

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.

This revision was automatically updated to reflect the committed changes.