GNOME Bugzilla – Bug 795625
compiles only with vintage ffmpeg
Last modified: 2018-05-17 08:06:46 UTC
gegl 0.4 and ffmpeg 4.0 make[3]: Entering directory '/usr/src/redhat/BUILD/gegl-0.4.0/operations/external' CC ff_save_la-ff-save.lo ff-save.c: In function ‘add_audio_stream’: ff-save.c:293:17: error: ‘CODEC_FLAG_GLOBAL_HEADER’ undeclared (first use in this function); did you mean ‘AV_CODEC_FLAG_GLOBAL_HEADER’? c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^~~~~~~~~~~~~~~~~~~~~~~~ AV_CODEC_FLAG_GLOBAL_HEADER ff-save.c:293:17: note: each undeclared identifier is reported only once for each function it appears in ff-save.c: In function ‘add_video_stream’: ff-save.c:634:18: error: ‘CODEC_FLAG_GLOBAL_HEADER’ undeclared (first use in this function); did you mean ‘AV_CODEC_FLAG_GLOBAL_HEADER’? c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^~~~~~~~~~~~~~~~~~~~~~~~ AV_CODEC_FLAG_GLOBAL_HEADER ff-save.c: In function ‘open_video’: ff-save.c:702:30: error: ‘AVFMT_RAWPICTURE’ undeclared (first use in this function); did you mean ‘AVFMT_NOFILE’? if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) ^~~~~~~~~~~~~~~~ AVFMT_NOFILE ff-save.c: In function ‘write_video_frame’: ff-save.c:806:28: error: ‘AVFMT_RAWPICTURE’ undeclared (first use in this function); did you mean ‘AVFMT_NOFILE’? if (oc->oformat->flags & AVFMT_RAWPICTURE) ^~~~~~~~~~~~~~~~ AVFMT_NOFILE make[3]: *** [Makefile:1177: ff_save_la-ff-save.lo] Error 1
Created attachment 371744 [details] [review] Fix builds against ffmpeg-4.0 Attached 'git format-patch' file fixes builds against ffmpeg-4.0. They've removed the since Oct 2015 deprecated AVFMT_RAWPICTURE, see https://github.com/FFmpeg/FFmpeg/commit/693a11b8a269c695c2608172c223be246dd7343e which was "unused" and also "CODEC_FLAG_GLOBAL_HEADER" which has been a #define to the "AV_"-prefixed constant since https://github.com/FFmpeg/FFmpeg/commit/7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615
Created attachment 371745 [details] [review] Fix builds against ffmpeg-2.3 to -2.7 Partially related: I tried building against ffmpeg-2.3.6 and ffmpeg-2.7.7 which failed due to AV_CODEC_CAP_VARIABLE_FRAME_SIZE AV_CODEC_CAP_INTRA_ONLY constants not being #defined by those old versions of ffmpeg. The attached patch fixes that. However, I suppose, a more reasonable approach at fixing this would be to let configure.ac require avformat/avcodec/swscale from >=v2.8 which would get rid of the preprocessor version check altogether.
Thank you for these fixes, we're now building with ffmpeg 4.0, even if our build still reports plenty of deprecations. commit a2dd56d3200aeafdecbc40c58eeef3d43a5fadcc Author: Franz Brausse <brausse@informatik.uni-trier.de> Date: Sun May 6 13:40:30 2018 +0200 operations/external/ff-save: ffmpeg-2.3-2.7 compat; minimum lav{f,c} versions configure.ac mandates commit 8f2545886ce3be8f1b1229bddcfa5af3216110d3 Author: Franz Brausse <brausse@informatik.uni-trier.de> Date: Sun May 6 13:38:09 2018 +0200 operations/external/ff-save: ffmpeg-4.0 compat; fixes #795625
Almost. ff-save.c:641:18: error: ‘CODEC_FLAG_GLOBAL_HEADER’ undeclared (first use in this function); did you mean ‘AV_CODEC_FLAG_GLOBAL_HEADER’? c->flags |= CODEC_FLAG_GLOBAL_HEADER; ^~~~~~~~~~~~~~~~~~~~~~~~ AV_CODEC_FLAG_GLOBAL_HEADER
commit 2896800b5e7d0c656710c70fdea57098032f3ccc Author: Øyvind Kolås <pippin@gimp.org> Date: Sun May 6 15:09:03 2018 +0200 ff-save: update another occurance of CODEC_FLAG_GLOBAL_HEADER