bakape / thumbnailer

Go media thumbnailer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile error

be195 opened this issue · comments

commented

If you try to use this library with clean ffmpeg (libraries) build, you would get this error (ffmpeg.h):

unknown type name 'AVCodecContext'; did you mean 'AVFormatContext'?
16 | int codec_context(AVCodecContext** avcc, int* stream, AVFormatContext

I assume it's most likely because ffmpeg.h is not including libavcodec/avcodec.h, which declares AVCodecContext.

I'm seeing the same issue on my end.

5.1.1. Let me know if there's any other way I can help.

commented

i also hit this...

me too

Reproduced Archlinux ffmpeg 6.0

Fixed by this PR, and merged on the Puter fork

For a quick fix until this is merged, assuming you're using modules:

git mod edit -replace github.com/bakape/thumbnailer/v2=github.com/HeyPuter/thumbnailer/v2@c526241bacef93a02053be748a6214751fe31cb1

This will temporarily use the patch commit on the Puter fork. When this is merged upstream, remove the replace line that was added to go.mod to continue getting patches from the bakape/thumbnailer.

Fixed by this PR, and merged on the Puter fork

For a quick fix until this is merged, assuming you're using modules:

git mod edit -replace github.com/bakape/thumbnailer/v2=github.com/HeyPuter/thumbnailer/v2@c526241bacef93a02053be748a6214751fe31cb1

This will temporarily use the patch commit on the Puter fork. When this is merged upstream, remove the replace line that was added to go.mod to continue getting patches from the bakape/thumbnailer.

Thanks for the fix! Btw, just to be pedantic, it should be go mod rather than git mod.

While it doesn't break anything, I see a few compile warnings coming from ffmpeg.c:

# github.com/bakape/thumbnailer/v2
ffmpeg.c: In function ‘create_context’:
ffmpeg.c:29:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   29 |         avif = av_find_input_format(input_format);
      |              ^
ffmpeg.c: In function ‘codec_context’:
ffmpeg.c:59:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   59 |         codec = avcodec_find_decoder_by_name("libvpx");
      |               ^
ffmpeg.c:62:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   62 |         codec = avcodec_find_decoder_by_name("libvpx-vp9");
      |               ^
ffmpeg.c:66:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |         codec = avcodec_find_decoder(st->codecpar->codec_id);
      |               ^

I'm not familiar with C, but is it possible to resolve these warnings?