Bug 208895 - graphics/opencv: Fix build with ffmpeg 3.0.x
Summary: graphics/opencv: Fix build with ffmpeg 3.0.x
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL: http://sources.debian.net/patches/ope...
Keywords: patch
Depends on:
Blocks: 207547
  Show dependency treegraph
 
Reported: 2016-04-18 14:25 UTC by Ben Woods
Modified: 2016-05-07 17:24 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (jhale)
woodsb02: maintainer-feedback? (jhale)


Attachments
Patch to fix build of graphics/opencv using ffmpeg 3.0.x (32.47 KB, patch)
2016-04-18 14:25 UTC, Ben Woods
woodsb02: maintainer-approval? (jhale)
Details | Diff
QA: Successful poudriere testport logs for graphics/opencv with patch against FFmpeg 3.0.1 (from PR 207547) on FreeBSD 11-current amd64 (gzipped) (52.84 KB, application/gzip)
2016-04-18 17:14 UTC, Ben Woods
no flags 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) (52.63 KB, application/gzip)
2016-04-18 21:24 UTC, Ben Woods
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer 2016-04-18 14:25:42 UTC
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/
Comment 1 Ben Woods freebsd_committer 2016-04-18 16:55:34 UTC
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
Comment 2 Ben Woods freebsd_committer 2016-04-18 17:14:25 UTC
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)
Comment 3 Ben Woods freebsd_committer 2016-04-18 21:24:17 UTC
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)
Comment 4 commit-hook freebsd_committer 2016-05-07 17:22:17 UTC
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
Comment 5 Jan Beich freebsd_committer 2016-05-07 17:24:00 UTC
Thanks. Committed.