Bug 227748 - multimedia/gstreamer1-libav: fails to build with ffmpeg 4.0 (blocks 300 ports)
Summary: multimedia/gstreamer1-libav: fails to build with ffmpeg 4.0 (blocks 300 ports)
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: freebsd-multimedia mailing list
URL:
Keywords: needs-patch
Depends on: 231406
Blocks: 227726
  Show dependency treegraph
 
Reported: 2018-04-24 15:04 UTC by Jan Beich
Modified: 2018-11-11 15:41 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (multimedia)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-04-24 15:04:25 UTC
After bug 227726 lands this port will end up BROKEN. Can you help?

$ fetch -qo- 'https://reviews.freebsd.org/D15175?download=true' | patch -Efsp0 -d /usr/ports
$ make all deinstall install clean -C/usr/ports/multimedia/ffmpeg
$ make -C/usr/ports/multimedia/gstreamer1-libav
[...]
gstavaudenc.c:286:26: error: no member named 'rc_strategy' in 'struct AVCodecContext'
  ffmpegaudenc->context->rc_strategy = 2;
  ~~~~~~~~~~~~~~~~~~~~~  ^
gstavaudenc.c:333:44: error: use of undeclared identifier 'CODEC_CAP_EXPERIMENTAL'
    if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
                                           ^
gstavvidenc.c:77:6: error: use of undeclared identifier 'ME_ZERO'
    {ME_ZERO, "None (Very low quality)", "zero"},
     ^
gstavvidenc.c:78:6: error: use of undeclared identifier 'ME_FULL'
    {ME_FULL, "Full (Slow, unmaintained)", "full"},
     ^
gstavvidenc.c:79:6: error: use of undeclared identifier 'ME_LOG'
    {ME_LOG, "Logarithmic (Low quality, unmaintained)", "logarithmic"},
     ^
gstavvidenc.c:80:6: error: use of undeclared identifier 'ME_PHODS'
    {ME_PHODS, "phods (Low quality, unmaintained)", "phods"},
     ^
gstavauddec.c:286:20: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
  params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
                   ^
gstavaudenc.c:605:32: error: use of undeclared identifier 'CODEC_CAP_VARIABLE_FRAME_SIZE'
    if ((codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) || !buffer) {
                               ^
gstavvidenc.c:81:6: error: use of undeclared identifier 'ME_EPZS'
    {ME_EPZS, "EPZS (Best quality, Fast)", "epzs"},
     ^
gstavvidenc.c:82:6: error: use of undeclared identifier 'ME_X1'
    {ME_X1, "X1 (Experimental)", "x1"},
     ^
gstavvidenc.c:206:31: error: use of undeclared identifier 'ME_EPZS'
          GST_TYPE_ME_METHOD, ME_EPZS,
                              ^
gstavaudenc.c:629:41: error: use of undeclared identifier 'CODEC_CAP_DELAY'
  if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
                                        ^
gstavauddec.c:668:41: error: use of undeclared identifier 'CODEC_CAP_DELAY'
  if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
                                        ^
gstav.c:33:10: fatal error: 'libavfilter/avfiltergraph.h' file not found
#include <libavfilter/avfiltergraph.h>
         ^
gstavvidenc.c:219:15: error: use of undeclared identifier 'CODEC_CAP_FRAME_THREADS'
  if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
              ^
gstavauddec.c:747:41: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
          || (map.maxsize - map.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
                                        ^
gstavvidenc.c:219:41: error: use of undeclared identifier 'CODEC_CAP_SLICE_THREADS'
  if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
                                        ^
gstavvidenc.c:262:26: error: use of undeclared identifier 'ME_EPZS'
  ffmpegenc->me_method = ME_EPZS;
                         ^
gstavvidenc.c:324:23: error: no member named 'me_method' in 'struct AVCodecContext'
  ffmpegenc->context->me_method = ffmpegenc->me_method;
  ~~~~~~~~~~~~~~~~~~  ^
gstavauddec.c:749:42: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
                                         ^
gstavvidenc.c:329:45: error: use of undeclared identifier 'CODEC_CAP_AUTO_THREADS'
    if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
                                            ^
gstavvidenc.c:346:23: error: no member named 'lmin' in 'struct AVCodecContext'; did you mean 'qmin'?
  ffmpegenc->context->lmin = (ffmpegenc->lmin * FF_QP2LAMBDA + 0.5);
                      ^~~~
                      qmin
/usr/local/include/libavcodec/avcodec.h:2355:9: note: 'qmin' declared here
    int qmin;
        ^
gstavvidenc.c:347:23: error: no member named 'lmax' in 'struct AVCodecContext'; did you mean 'qmax'?
  ffmpegenc->context->lmax = (ffmpegenc->lmax * FF_QP2LAMBDA + 0.5);
                      ^~~~
                      qmax
/usr/local/include/libavcodec/avcodec.h:2362:9: note: 'qmax' declared here
    int qmax;
        ^
gstavauddec.c:750:40: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
      ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
                                       ^
gstavvidenc.c:351:9: error: use of undeclared identifier 'CODEC_FLAG_INTERLACED_DCT'
        CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME;
        ^
gstavauddec.c:758:43: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
                                          ^
gstavvidenc.c:351:37: error: use of undeclared identifier 'CODEC_FLAG_INTERLACED_ME'
        CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME;
                                    ^
gstavvidenc.c:355:23: error: no member named 'rc_strategy' in 'struct AVCodecContext'
  ffmpegenc->context->rc_strategy = 2;
  ~~~~~~~~~~~~~~~~~~  ^
gstavviddec.c:240:15: error: use of undeclared identifier 'CODEC_CAP_FRAME_THREADS'
  if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
              ^
gstavcodecmap.c:821:57: error: use of undeclared identifier 'CODEC_FLAG_4MV'
            "annex-f", G_TYPE_BOOLEAN, context->flags & CODEC_FLAG_4MV,
                                                        ^
gstavvidenc.c:365:10: error: use of undeclared identifier 'CODEC_FLAG_QSCALE'
    case CODEC_FLAG_QSCALE:
         ^
gstavauddec.c:767:24: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
                       ^
gstavviddec.c:240:41: error: use of undeclared identifier 'CODEC_CAP_SLICE_THREADS'
  if (caps & (CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS)) {
                                        ^
gstavvidenc.c:369:10: error: use of undeclared identifier 'CODEC_FLAG_PASS1'
    case CODEC_FLAG_PASS1:     /* need to prepare a stats file */
         ^
gstavauddec.c:777:31: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
      memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
                              ^
gstavviddec.c:368:7: error: use of undeclared identifier 'CODEC_FLAG_OUTPUT_CORRUPT'
      CODEC_FLAG_OUTPUT_CORRUPT, ffmpegdec->output_corrupt);
      ^
gstavcodecmap.c:3188:15: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
              FF_INPUT_BUFFER_PADDING_SIZE));
              ^
gstavcodecmap.c:3212:25: error: use of undeclared identifier 'CODEC_FLAG_4MV'
      context->flags |= CODEC_FLAG_4MV;
                        ^
gstavcodecmap.c:3224:31: error: use of undeclared identifier 'CODEC_FLAG_GMC'
            context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
                              ^
gstavviddec.c:498:47: error: use of undeclared identifier 'CODEC_CAP_AUTO_THREADS'
      if (!(oclass->in_plugin->capabilities & CODEC_CAP_AUTO_THREADS))
                                              ^
gstavcodecmap.c:3224:48: error: use of undeclared identifier 'CODEC_FLAG_QPEL'
            context->flags |= CODEC_FLAG_GMC | CODEC_FLAG_QPEL;
                                               ^
gstavviddec.c:627:35: error: use of undeclared identifier 'CODEC_FLAG_EMU_EDGE'
  if (ffmpegdec->context->flags & CODEC_FLAG_EMU_EDGE)
                                  ^
gstavcodecmap.c:3330:27: error: use of undeclared identifier 'CODEC_FLAG_4MV'
        context->flags |= CODEC_FLAG_4MV;
                          ^
gstavviddec.c:735:46: error: use of undeclared identifier 'CODEC_CAP_DR1'
  return ((oclass->in_plugin->capabilities & CODEC_CAP_DR1) == CODEC_CAP_DR1);
                                             ^
gstavcodecmap.c:3332:28: error: use of undeclared identifier 'CODEC_FLAG_4MV'
        context->flags &= ~CODEC_FLAG_4MV;
                           ^
gstavviddec.c:735:64: error: use of undeclared identifier 'CODEC_CAP_DR1'
  return ((oclass->in_plugin->capabilities & CODEC_CAP_DR1) == CODEC_CAP_DR1);
                                                               ^
gstavcodecmap.c:3335:27: error: use of undeclared identifier 'CODEC_FLAG_AC_PRED'
        context->flags |= CODEC_FLAG_AC_PRED;
                          ^
gstavviddec.c:1772:41: error: use of undeclared identifier 'CODEC_CAP_DELAY'
  if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
                                        ^
gstavcodecmap.c:3337:28: error: use of undeclared identifier 'CODEC_FLAG_AC_PRED'
        context->flags &= ~CODEC_FLAG_AC_PRED;
                           ^
gstavcfg.c:45:8: error: use of undeclared identifier 'CODEC_FLAG_QSCALE'
      {CODEC_FLAG_QSCALE, "Constant Quantizer", "quant"},
       ^
gstavcfg.c:46:8: error: use of undeclared identifier 'CODEC_FLAG_PASS1'
      {CODEC_FLAG_PASS1, "VBR Encoding - Pass 1", "pass1"},
       ^
gstavcfg.c:47:8: error: use of undeclared identifier 'CODEC_FLAG_PASS2'
      {CODEC_FLAG_PASS2, "VBR Encoding - Pass 2", "pass2"},
       ^
gstavcodecmap.c:3339:27: error: use of undeclared identifier 'CODEC_FLAG_LOOP_FILTER'
        context->flags |= CODEC_FLAG_LOOP_FILTER;
                          ^
gstavviddec.c:1818:45: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
          || (minfo.maxsize - minfo.size) < FF_INPUT_BUFFER_PADDING_SIZE)) {
                                            ^
gstavcfg.c:263:8: error: use of undeclared identifier 'CODEC_FLAG_QSCALE'
      {CODEC_FLAG_QSCALE, "Use fixed qscale", "qscale"},
       ^
gstavcfg.c:264:8: error: use of undeclared identifier 'CODEC_FLAG_4MV'
      {CODEC_FLAG_4MV, "Allow 4 MV per MB", "4mv"},
       ^
gstavcodecmap.c:3341:28: error: use of undeclared identifier 'CODEC_FLAG_LOOP_FILTER'
        context->flags &= ~CODEC_FLAG_LOOP_FILTER;
                           ^
gstavviddec.c:1820:42: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    if (ffmpegdec->padded_size < bsize + FF_INPUT_BUFFER_PADDING_SIZE) {
                                         ^
gstavcfg.c:265:8: error: use of undeclared identifier 'CODEC_FLAG_QPEL'
      {CODEC_FLAG_QPEL, "Quartel Pel Motion Compensation", "qpel"},
       ^
gstavcfg.c:266:8: error: use of undeclared identifier 'CODEC_FLAG_GMC'
      {CODEC_FLAG_GMC, "GMC", "gmc"},
       ^
gstavcfg.c:267:8: error: use of undeclared identifier 'CODEC_FLAG_MV0'
      {CODEC_FLAG_MV0, "Always try a MB with MV (0,0)", "mv0"},
       ^
gstavviddec.c:1821:40: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
      ffmpegdec->padded_size = bsize + FF_INPUT_BUFFER_PADDING_SIZE;
                                       ^
gstavcfg.c:268:8: error: use of undeclared identifier 'CODEC_FLAG_LOOP_FILTER'
      {CODEC_FLAG_LOOP_FILTER, "Loop filter", "loop-filter"},
       ^
gstavviddec.c:1829:43: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    memset (ffmpegdec->padded + bsize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
                                          ^
gstavcfg.c:269:8: error: use of undeclared identifier 'CODEC_FLAG_GRAY'
      {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"},
       ^
gstavviddec.c:1838:24: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
    guint8 tmp_padding[FF_INPUT_BUFFER_PADDING_SIZE];
                       ^
gstavcfg.c:270:8: error: use of undeclared identifier 'CODEC_FLAG_NORMALIZE_AQP'
      {CODEC_FLAG_NORMALIZE_AQP,
       ^
gstavviddec.c:1849:31: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
      memset (data + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
                              ^
gstavcfg.c:272:8: error: use of undeclared identifier 'CODEC_FLAG_GLOBAL_HEADER'
      {CODEC_FLAG_GLOBAL_HEADER,
       ^
gstavcfg.c:275:8: error: use of undeclared identifier 'CODEC_FLAG_AC_PRED'
      {CODEC_FLAG_AC_PRED, "H263 Advanced Intra Coding / MPEG4 AC prediction",
       ^
gstavviddec.c:2146:20: error: use of undeclared identifier 'FF_INPUT_BUFFER_PADDING_SIZE'
  params.padding = FF_INPUT_BUFFER_PADDING_SIZE;
                   ^
gstavcfg.c:277:8: error: use of undeclared identifier 'CODEC_FLAG_CLOSED_GOP'
      {CODEC_FLAG_CLOSED_GOP, "Closed GOP", "closedgop"},
       ^
gstavcfg.c:493:3: error: no member named 'rc_qsquish' in 'AVCodecContext'
  gst_ffmpeg_add_pspec (pspec, config.rc_qsquish, FALSE, mpeg, NULL);
  ^                                  ~~~~~~~~~~~
gstavcfg.c:493:39: error: no member named 'rc_qsquish' in 'struct AVCodecContext'
  gst_ffmpeg_add_pspec (pspec, config.rc_qsquish, FALSE, mpeg, NULL);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gstavcfg.c:498:3: error: no member named 'rc_qmod_amp' in 'AVCodecContext'
  gst_ffmpeg_add_pspec (pspec, config.rc_qmod_amp, FALSE, mpeg, NULL);
  ^                                  ~~~~~~~~~~~~
gstavcfg.c:502:3: error: no member named 'rc_qmod_freq' in 'AVCodecContext'
  gst_ffmpeg_add_pspec (pspec, config.rc_qmod_freq, FALSE, mpeg, NULL);
  ^                                  ~~~~~~~~~~~~~

build log: https://ptpb.pw/xIds
Comment 1 Jan Beich freebsd_committer 2018-04-29 00:54:51 UTC
ports r468598 added FFMPEG option to be disabled when bug 227726 lands.
Comment 2 Ben Woods freebsd_committer 2018-06-04 05:41:16 UTC
Note that ArchLinux has followed a similar path - changed their gstreamer1-libav package to use the internal libav instead of the external ffmpeg package.
https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/gst-libav&id=e3b49f937a40df4a5861fb96c38a86bfebdb3b97

Also, the newer version of gstreamer 1.14 still does not support ffmpeg 4.0:
https://gstreamer.freedesktop.org/releases/1.14/#1.14.2
Comment 3 Tijl Coosemans freebsd_committer 2018-06-04 07:41:14 UTC
Aren't there security problems with the bundled libav?
Comment 4 commit-hook freebsd_committer 2018-11-11 15:40:45 UTC
A commit references this bug:

Author: jbeich
Date: Sun Nov 11 15:39:43 UTC 2018
New revision: 484697
URL: https://svnweb.freebsd.org/changeset/ports/484697

Log:
  multimedia/gstreamer1-libav: unbreak and enable system ffmpeg

  PR:		227748
  Obtained from:	upstream
  Security:	CVE-2018-7557
  Security:	CVE-2018-7751
  Security:	CVE-2018-10001
  Security:	CVE-2018-12458
  Security:	CVE-2018-13300
  Security:	CVE-2018-13302
  Security:	CVE-2018-14394
  Security:	CVE-2018-14395
  Security:	CVE-2018-15822

Changes:
  head/multimedia/gstreamer1-libav/Makefile
  head/multimedia/gstreamer1-libav/files/patch-ffmpeg4