Created attachment 169435 [details] Patch to fix build of graphics/opencv using ffmpeg 3.0.x graphics/opencv: Fix build with ffmpeg 3.0.x Add patch to allow opencv to build successfully once multimedia/ffmpeg is updated to 3.0.x. Note that multimedia/ffmpeg is currently still on the 2.8.x branch, however this patch is backwards compatible with ffmpeg 2.8.x. Note: these patches are obtained from Debian [1], and it was pointed out that they would fix the build with FFmpeg 3.0.x by Jan Beich in PR 207547. [1] http://sources.debian.net/patches/opencv/2.4.9.1%2Bdfsg-1.5/
graphics/opencv only fails to build with ffmpeg 3.0.x if the port has the FFMPEG option set (not default). When building without the attached patch, with the FFMPEG option set and ffmpeg 3.0.x, the build fails with many errors similar to this: In file included from /wrkdirs/usr/ports/graphics/opencv/work/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:60: /wrkdirs/usr/ports/graphics/opencv/work/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:104:7: error: use of undeclared identifier 'CODEC_ID_H264'; did you mean 'AV_CODEC_ID_H264'? { CODEC_ID_H264, MKTAG('H', '2', '6', '4') }, ^~~~~~~~~~~~~ AV_CODEC_ID_H264 Refer to the full build log without the attached patch here: http://package22.nyi.freebsd.org/data/103i386-default-PR207547/2016-02-27_20h30m58s/logs/errors/opencv-2.4.9_7.log
Created attachment 169446 [details] QA: Successful poudriere testport logs for graphics/opencv with patch against FFmpeg 3.0.1 (from PR 207547) on FreeBSD 11-current amd64 (gzipped)
Created attachment 169458 [details] QA: Successful poudriere testport logs for graphics/opencv with patch against current ports tree (FFmpeg 2.8.6_2,1) on FreeBSD 11-current amd64 (gzipped)
A commit references this bug: Author: jbeich Date: Sat May 7 17:22:02 UTC 2016 New revision: 414777 URL: https://svnweb.freebsd.org/changeset/ports/414777 Log: graphics/opencv: unbreak build with ffmpeg 3.0 modules/highgui/src/ffmpeg_codecs.hpp:104:7: error: use of undeclared identifier 'CODEC_ID_H264'; did you mean 'AV_CODEC_ID_H264'? { CODEC_ID_H264, MKTAG('H', '2', '6', '4') }, ^~~~~~~~~~~~~ modules/highgui/src/ffmpeg_codecs.hpp:121:7: error: use of undeclared identifier 'CODEC_ID_MPEG4'; did you mean 'AV_CODEC_ID_MPEG4'? { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X') }, ^~~~~~~~~~~~~~ [...] PR: 208895 Reported by: antoine (via exp-run) Submitted by: Ben Woods <woodsb02@gmail.com> Approved by: maintainer timeout (jhale, 3 weeks) Obtained from: Debian Changes: head/graphics/opencv/Makefile head/graphics/opencv/files/patch-ffmpeg29 head/graphics/opencv/files/patch-libav10
Thanks. Committed.