thumbnailer icon indicating copy to clipboard operation
thumbnailer copied to clipboard

Compile error

Open be195 opened this issue 2 years ago • 8 comments

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.

be195 avatar Oct 08 '22 04:10 be195

I'm seeing the same issue on my end.

benjohnson avatar Oct 10 '22 14:10 benjohnson

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: @.***>

bakape avatar Oct 11 '22 08:10 bakape

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

benjohnson avatar Oct 11 '22 16:10 benjohnson

i also hit this...

gedw99 avatar Nov 23 '22 12:11 gedw99

me too

amlwwalker avatar Feb 07 '23 10:02 amlwwalker

Reproduced Archlinux ffmpeg 6.0

KernelDeimos avatar Aug 28 '23 22:08 KernelDeimos

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.

KernelDeimos avatar Aug 28 '23 23:08 KernelDeimos

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?

phasetri avatar Dec 07 '23 00:12 phasetri