Skip to content

Thumbnailing fails with interlaced PNG #195

@aearil

Description

@aearil

ffmpegthumbnailer CLI as well as libffmpegthumbnailer fail to produce a thumbnail for interlaced PNG images.

For example, when running

ffmpegthumbnailer -i a_difficult_situation.png -o a_difficult_situation.thumb.png

with the following image:
a_difficult_situation

I get an empty file and this output in the terminal:

Seeking in video failed Operation not permitted, will use first frame.
Error: decodeVideoFrame() failed: frame not finished

I spent a while trying to fix the issue on my own, but I lack a good understanding of how libav is supposed to work.

I narrowed down the issue to MovieDecoder::getScaledVideoFrame() https://github.com/dirkvdb/ffmpegthumbnailer/blob/master/libffmpegthumbnailer/moviedecoder.cpp#L609

Where av_buffersink_get_frame() is called, returns AVERROR(EAGAIN), and when we try to call decodeVideoFrame() in the subsequent loop, there isn't actually any data left to decode.

If you don't have time to write a fix yourself, I would appreciate some precise pointers on how I could write a fix for the issue, thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions