-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build problem: ‘AV_CODEC_ID_AV1’ undeclared #3939
Comments
Your FFmpeg is VERY old. What is the result of Does it work with this additional diff? diff --git a/app/src/compat.h b/app/src/compat.h
index 00cb72045..9209dd31c 100644
--- a/app/src/compat.h
+++ b/app/src/compat.h
@@ -25,6 +25,12 @@
# define SCRCPY_LAVF_REQUIRES_REGISTER_ALL
#endif
+// Not documented in ffmpeg/doc/APIchanges, but AV_CODEC_ID_AV1 was added has
+// been added by FFmpeg commit d42809f9835a4e9e5c7c63210abb09ad0ef19cfb
+// (included in tag n3.3).
+#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 89, 100)
+# define SCRCPY_LAVC_HAS_AV1
+#endif
// In ffmpeg/doc/APIchanges:
// 2018-01-28 - ea3672b7d6 - lavf 58.7.100 - avformat.h
diff --git a/app/src/demuxer.c b/app/src/demuxer.c
index 5a613505d..4fcdd9ade 100644
--- a/app/src/demuxer.c
+++ b/app/src/demuxer.c
@@ -33,7 +33,12 @@ sc_demuxer_to_avcodec_id(uint32_t codec_id) {
case SC_CODEC_ID_H265:
return AV_CODEC_ID_HEVC;
case SC_CODEC_ID_AV1:
+#ifdef SCRCPY_LAVC_HAS_AV1
return AV_CODEC_ID_AV1;
+#else
+ LOGE("AV1 not supported by this FFmpeg version");
+ return AV_CODEC_ID_NONE;
+#endif
case SC_CODEC_ID_OPUS:
return AV_CODEC_ID_OPUS;
case SC_CODEC_ID_AAC: |
ffmpeg: with the additional diff I have same output MESON: Found ninja-1.7.2 at /usr/bin/ninja NINJA: thanks! |
Oops, I reversed the condition. I updated the diff in my previous comment, please re-test. |
yes, now works :) |
Pushed on |
on debian strech 32
ninja: Entering directory `x'
[14/62] Compiling C object app/scrcpy.p/src_demuxer.c.o
FAILED: app/scrcpy.p/src_demuxer.c.o
cc -Iapp/scrcpy.p -Iapp -I../app -I../app/src -I/usr/include/i386-linux-gnu -I/usr/include/SDL2 -I/usr/include/libusb-1.0 -flto -fdiagnostics-color=always -DNDEBUG -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c11 -O3 -D_REENTRANT -MD -MQ app/scrcpy.p/src_demuxer.c.o -MF app/scrcpy.p/src_demuxer.c.o.d -o app/scrcpy.p/src_demuxer.c.o -c ../app/src/demuxer.c
../app/src/demuxer.c: In function ‘sc_demuxer_to_avcodec_id’:
../app/src/demuxer.c:36:20: error: ‘AV_CODEC_ID_AV1’ undeclared (first use in this function)
return AV_CODEC_ID_AV1;
^~~~~~~~~~~~~~~
../app/src/demuxer.c:36:20: note: each undeclared identifier is reported only once for each function it appears in
[16/62] Compiling C object app/scrcpy.p/src_icon.c.o
ninja: build stopped: subcommand failed.
thanks for any suggestions
The text was updated successfully, but these errors were encountered: