Compile error
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.
What FFmpeg versions are you compiling against?
On Mon, 10 Oct 2022 at 17:03, Ben Johnson @.***> wrote:
I'm seeing the same issue on my end.
— Reply to this email directly, view it on GitHub https://github.com/bakape/thumbnailer/issues/76#issuecomment-1273363506, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MHYZFLD27GRFGNHV5TWCQO2PANCNFSM6AAAAAARACRZ3U . You are receiving this because you are subscribed to this thread.Message ID: @.***>
5.1.1. Let me know if there's any other way I can help.
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@c526241bacef93a02053be748a6214751fe31cb1This will temporarily use the patch commit on the Puter fork. When this is merged upstream, remove the
replaceline that was added togo.modto 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?