Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Compile error #76

Open
be195 opened this issue Oct 8, 2022 · 8 comments · May be fixed by #79
Open

Compile error #76

be195 opened this issue Oct 8, 2022 · 8 comments · May be fixed by #79

Comments

@be195
Copy link

be195 commented Oct 8, 2022

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.

@benjohnson
Copy link

I'm seeing the same issue on my end.

@bakape
Copy link
Owner

bakape commented Oct 11, 2022 via email

@benjohnson
Copy link

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

@gedw99
Copy link

gedw99 commented Nov 23, 2022

i also hit this...

@amlwwalker
Copy link

me too

@KernelDeimos
Copy link

Reproduced Archlinux ffmpeg 6.0

@KernelDeimos KernelDeimos linked a pull request Aug 28, 2023 that will close this issue
@KernelDeimos
Copy link

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.

@phasetri
Copy link

phasetri commented Dec 7, 2023

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants