Opened 5 years ago

Closed 4 years ago

#50697 closed defect (fixed)

VLC @2.2.2: build fails when using recently released ffmpeg-3.0

Reported by: dbevans (David B. Evans) Owned by: RJVB (René Bertin)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mojca (Mojca Miklavec), majoc-at-astro (majoc-at-astro), Schamschula (Marius Schamschula), jeremyhu (Jeremy Huddleston Sequoia), mkae (Marko Käning), vit0rg, mklein-de (Michael Klein), michaellass (Michael Lass), khepler, AlD (Daniel Albers), ojkastl
Port: VLC VLC-devel

Description (last modified by mojca (Mojca Miklavec))

Build fails due to the use of long deprecated API that has finally been dropped in this major release. See FFmpeg doc/APIchanges for the details of FFmpeg API changes/deprecations over time along with suggested alternatives. See ticket #50694.

(Updating the VLC-devel port to the latest git commit may help.)

Build fails as follows. Full build log attached.

../../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -isysroot / -DHAVE_CONFIG_H -I. -I../..  -DMODULE_NAME=$(p="libavcodec_plugin_la-video.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_NAME_IS_$(p="libavcodec_plugin_la-video.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_STRING=\"$(p="libavcodec_plugin_la-video.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}")\" -D__PLUGIN__ -I../../include -I../../include -I/opt/local/include -D__unix__=1 -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include  -I/opt/local/include  -I/opt/local/include   -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -MT libavcodec_plugin_la-video.lo -MD -MP -MF .deps/libavcodec_plugin_la-video.Tpo -c -o libavcodec_plugin_la-video.lo `test -f 'avcodec/video.c' || echo './'`avcodec/video.c
mv -f .deps/libedummy_plugin_la-edummy.Tpo .deps/libedummy_plugin_la-edummy.Plo
../../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -isysroot / -DHAVE_CONFIG_H -I. -I../..  -DMODULE_NAME=$(p="libavcodec_plugin_la-subtitle.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_NAME_IS_$(p="libavcodec_plugin_la-subtitle.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_STRING=\"$(p="libavcodec_plugin_la-subtitle.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}")\" -D__PLUGIN__ -I../../include -I../../include -I/opt/local/include -D__unix__=1 -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include  -I/opt/local/include  -I/opt/local/include   -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -MT libavcodec_plugin_la-subtitle.lo -MD -MP -MF .deps/libavcodec_plugin_la-subtitle.Tpo -c -o libavcodec_plugin_la-subtitle.lo `test -f 'avcodec/subtitle.c' || echo './'`avcodec/subtitle.c
mv -f .deps/libscte27_plugin_la-scte27.Tpo .deps/libscte27_plugin_la-scte27.Plo
../../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -isysroot / -DHAVE_CONFIG_H -I. -I../..  -DMODULE_NAME=$(p="libavcodec_plugin_la-audio.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_NAME_IS_$(p="libavcodec_plugin_la-audio.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_STRING=\"$(p="libavcodec_plugin_la-audio.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}")\" -D__PLUGIN__ -I../../include -I../../include -I/opt/local/include -D__unix__=1 -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include  -I/opt/local/include  -I/opt/local/include   -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -MT libavcodec_plugin_la-audio.lo -MD -MP -MF .deps/libavcodec_plugin_la-audio.Tpo -c -o libavcodec_plugin_la-audio.lo `test -f 'avcodec/audio.c' || echo './'`avcodec/audio.c
In file included from avcodec/video.c:43:
In file included from avcodec/avcodec.h:25:
avcodec/avcommon.h:57:5: warning: 'av_set_cpu_flags_mask' is deprecated [-Wdeprecated-declarations]
    av_set_cpu_flags_mask( INT_MAX & ~GetVlcDspMask() );
    ^
/opt/local/include/libavutil/cpu.h:91:27: note: 'av_set_cpu_flags_mask' has been explicitly marked deprecated here
attribute_deprecated void av_set_cpu_flags_mask(int mask);
                          ^
avcodec/video.c:203:23: error: implicit declaration of function 'avcodec_alloc_frame' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    p_sys->p_ff_pic = avcodec_alloc_frame();
                      ^
avcodec/video.c:203:21: warning: incompatible integer to pointer conversion assigning to 'AVFrame *' (aka 'struct AVFrame *') from 'int' [-Wint-conversion]
    p_sys->p_ff_pic = avcodec_alloc_frame();
                    ^ ~~~~~~~~~~~~~~~~~~~~~
In file included from avcodec/subtitle.c:39:
In file included from avcodec/avcodec.h:25:
avcodec/avcommon.h:57:5: warning: 'av_set_cpu_flags_mask' is deprecated [-Wdeprecated-declarations]
    av_set_cpu_flags_mask( INT_MAX & ~GetVlcDspMask() );
    ^
/opt/local/include/libavutil/cpu.h:91:27: note: 'av_set_cpu_flags_mask' has been explicitly marked deprecated here
attribute_deprecated void av_set_cpu_flags_mask(int mask);
                          ^
avcodec/video.c:320:23: error: no member named 'get_buffer' in 'struct AVCodecContext'; did you mean 'get_buffer2'?
    p_sys->p_context->get_buffer = ffmpeg_GetFrameBuf;
                      ^~~~~~~~~~
                      get_buffer2
avcodec/subtitle.c:217:45: warning: 'pict' is deprecated [-Wdeprecated-declarations]
            const uint8_t index = ffregion->pict.data[0][y * ffregion->w+x];
                                            ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
avcodec/subtitle.c:217:50: warning: 'data' is deprecated [-Wdeprecated-declarations]
            const uint8_t index = ffregion->pict.data[0][y * ffregion->w+x];
                                                 ^
/opt/local/include/libavcodec/avcodec.h:3668:14: note: 'data' has been explicitly marked deprecated here
    uint8_t *data[AV_NUM_DATA_POINTERS];    ///< pointers to the image data planes
             ^
avcodec/subtitle.c:221:39: warning: 'pict' is deprecated [-Wdeprecated-declarations]
            memcpy(&color, &ffregion->pict.data[1][4*index], 4);
                                      ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
avcodec/subtitle.c:221:44: warning: 'data' is deprecated [-Wdeprecated-declarations]
            memcpy(&color, &ffregion->pict.data[1][4*index], 4);
                                           ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
/opt/local/include/libavcodec/avcodec.h:3668:14: note: 'data' has been explicitly marked deprecated here
    uint8_t *data[AV_NUM_DATA_POINTERS];    ///< pointers to the image data planes
             ^
/opt/local/include/libavcodec/avcodec.h:2442:11: note: 'get_buffer2' declared here
avcodec/subtitle.c:284:9: warning: 'avpicture_free' is deprecated [-Wdeprecated-declarations]
    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
        avpicture_free(&rec->pict);          ^

        ^
/opt/local/include/libavcodec/avcodec.h:4877:6: note: 'avpicture_free' has been explicitly marked deprecated here
void avpicture_free(AVPicture *picture);
     ^
avcodec/subtitle.c:284:30: warning: 'pict' is deprecated [-Wdeprecated-declarations]
        avpicture_free(&rec->pict);
                             ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
avcodec/video.c:320:34: warning: incompatible pointer types assigning to 'int (*)(struct AVCodecContext *, AVFrame *, int)' from 'int (struct AVCodecContext *, AVFrame *)' [-Wincompatible-pointer-types]
    p_sys->p_context->get_buffer = ffmpeg_GetFrameBuf;
                                 ^ ~~~~~~~~~~~~~~~~~~
avcodec/video.c:321:23: error: no member named 'reget_buffer' in 'struct AVCodecContext'; did you mean 'get_buffer2'?
    p_sys->p_context->reget_buffer = avcodec_default_reget_buffer;
                      ^~~~~~~~~~~~
                      get_buffer2
/opt/local/include/libavcodec/avcodec.h:2442:11: note: 'get_buffer2' declared here
    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
          ^
avcodec/video.c:321:38: error: use of undeclared identifier 'avcodec_default_reget_buffer'; did you mean 'avcodec_default_get_buffer2'?
    p_sys->p_context->reget_buffer = avcodec_default_reget_buffer;
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     avcodec_default_get_buffer2
/opt/local/include/libavcodec/avcodec.h:4219:5: note: 'avcodec_default_get_buffer2' declared here
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
    ^
avcodec/video.c:322:23: error: no member named 'release_buffer' in 'struct AVCodecContext'
    p_sys->p_context->release_buffer = ffmpeg_ReleaseFrameBuf;
    ~~~~~~~~~~~~~~~~  ^
avcodec/video.c:367:38: warning: incompatible pointer types assigning to 'enum AVPixelFormat (*)(struct AVCodecContext *, const enum AVPixelFormat *)' from 'enum PixelFormat (AVCodecContext *, const enum PixelFormat *)' [-Wincompatible-pointer-types]
        p_sys->p_context->get_format = ffmpeg_GetFormat;
                                     ^ ~~~~~~~~~~~~~~~~
avcodec/video.c:639:25: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
        else if( i_used > p_block->i_buffer ||
                 ~~~~~~ ^ ~~~~~~~~~~~~~~~~~
avcodec/video.c:938:15: error: no member named 'type' in 'struct AVFrame'
    p_ff_pic->type = FF_BUFFER_TYPE_USER;
    ~~~~~~~~  ^
avcodec/video.c:938:22: error: use of undeclared identifier 'FF_BUFFER_TYPE_USER'
    p_ff_pic->type = FF_BUFFER_TYPE_USER;
                     ^
avcodec/video.c:955:31: error: use of undeclared identifier 'PIX_FMT_PAL8'; did you mean 'AV_PIX_FMT_PAL8'?
    if (p_context->pix_fmt == PIX_FMT_PAL8)
                              ^~~~~~~~~~~~
                              AV_PIX_FMT_PAL8
/opt/local/include/libavutil/pixfmt.h:74:5: note: 'AV_PIX_FMT_PAL8' declared here
    AV_PIX_FMT_PAL8,      ///< 8 bit with AV_PIX_FMT_RGB32 palette
    ^
avcodec/video.c:990:31: error: use of undeclared identifier 'PIX_FMT_YUV422P'; did you mean 'AV_PIX_FMT_YUV422P'?
    if( p_context->pix_fmt == PIX_FMT_YUV422P )
                              ^~~~~~~~~~~~~~~
                              AV_PIX_FMT_YUV422P
/opt/local/include/libavutil/pixfmt.h:67:5: note: 'AV_PIX_FMT_YUV422P' declared here
    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
    ^
avcodec/video.c:1031:16: error: implicit declaration of function 'avcodec_default_get_buffer' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        return avcodec_default_get_buffer( p_context, p_ff_pic );
               ^
avcodec/video.c:1031:16: note: did you mean 'avcodec_default_get_buffer2'?
/opt/local/include/libavcodec/avcodec.h:4219:5: note: 'avcodec_default_get_buffer2' declared here
int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
    ^
avcodec/video.c:1058:15: error: no member named 'type' in 'struct AVFrame'
    p_ff_pic->type = FF_BUFFER_TYPE_USER;
    ~~~~~~~~  ^
avcodec/video.c:1058:22: error: use of undeclared identifier 'FF_BUFFER_TYPE_USER'
    p_ff_pic->type = FF_BUFFER_TYPE_USER;
                     ^
avcodec/video.c:1082:24: error: no member named 'type' in 'struct AVFrame'
    else if( p_ff_pic->type == FF_BUFFER_TYPE_INTERNAL )
             ~~~~~~~~  ^
avcodec/audio.c:42:10: fatal error: 'libavutil/audioconvert.h' file not found
#include <libavutil/audioconvert.h>
         ^
7 warnings generated.
avcodec/video.c:1082:32: error: use of undeclared identifier 'FF_BUFFER_TYPE_INTERNAL'
    else if( p_ff_pic->type == FF_BUFFER_TYPE_INTERNAL )
                               ^
avcodec/video.c:1087:9: error: implicit declaration of function 'avcodec_default_release_buffer' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        avcodec_default_release_buffer( p_context, p_ff_pic );
        ^
mv -f .deps/libavcodec_plugin_la-subtitle.Tpo .deps/libavcodec_plugin_la-subtitle.Plo
../../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -isysroot / -DHAVE_CONFIG_H -I. -I../..  -DMODULE_NAME=$(p="libavcodec_plugin_la-cpu.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_NAME_IS_$(p="libavcodec_plugin_la-cpu.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}") -DMODULE_STRING=\"$(p="libavcodec_plugin_la-cpu.lo"; p="${p##*/}"; p="${p#lib}"; echo "${p%_plugin*}")\" -D__PLUGIN__ -I../../include -I../../include -I/opt/local/include -D__unix__=1 -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include  -I/opt/local/include  -I/opt/local/include   -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -ffast-math -funroll-loops -fomit-frame-pointer -MT libavcodec_plugin_la-cpu.lo -MD -MP -MF .deps/libavcodec_plugin_la-cpu.Tpo -c -o libavcodec_plugin_la-cpu.lo `test -f 'avcodec/cpu.c' || echo './'`avcodec/cpu.c
1 error generated.
avcodec/video.c:1087:9: note: did you mean 'avcodec_default_get_buffer'?
avcodec/video.c:1031:16: note: 'avcodec_default_get_buffer' declared here
        return avcodec_default_get_buffer( p_context, p_ff_pic );
               ^
make[4]: *** [libavcodec_plugin_la-audio.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
avcodec/video.c:1135:25: error: incomplete result type 'enum PixelFormat' in function definition
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
                        ^
avcodec/video.c:108:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
avcodec/video.c:1157:30: error: subscript of pointer to incomplete type 'const enum PixelFormat'
    for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
                       ~~~~~~^
avcodec/video.c:108:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
avcodec/video.c:1157:37: error: use of undeclared identifier 'PIX_FMT_NONE'; did you mean 'AV_PIX_FMT_NONE'?
    for( size_t i = 0; pi_fmt[i] != PIX_FMT_NONE; i++ )
                                    ^~~~~~~~~~~~
                                    AV_PIX_FMT_NONE
/opt/local/include/libavutil/pixfmt.h:62:5: note: 'AV_PIX_FMT_NONE' declared here
    AV_PIX_FMT_NONE = -1,
    ^
avcodec/video.c:1159:54: error: subscript of pointer to incomplete type 'const enum PixelFormat'
        const char *name = av_get_pix_fmt_name(pi_fmt[i]);
                                               ~~~~~~^
avcodec/video.c:108:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make[4]: *** [libavcodec_plugin_la-video.lo] Error 1
In file included from avcodec/cpu.c:30:
avcodec/avcommon.h:57:5: warning: 'av_set_cpu_flags_mask' is deprecated [-Wdeprecated-declarations]
    av_set_cpu_flags_mask( INT_MAX & ~GetVlcDspMask() );
    ^
/opt/local/include/libavutil/cpu.h:91:27: note: 'av_set_cpu_flags_mask' has been explicitly marked deprecated here
attribute_deprecated void av_set_cpu_flags_mask(int mask);
                          ^
1 warning generated.
mv -f .deps/libavcodec_plugin_la-cpu.Tpo .deps/libavcodec_plugin_la-cpu.Plo
mv -f .deps/libdvbsub_plugin_la-dvbsub.Tpo .deps/libdvbsub_plugin_la-dvbsub.Plo
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/modules/codec'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/modules/codec'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5'
Command failed:  cd "/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5" && /usr/bin/make -j4 -w all DESTDIR=/opt/local/var/macports/build/_opt_macports_trunk_dports_multimedia_VLC/VLC/work/vlc-2.1.5/dest_ignore V=1 

Attachments (5)

main.log (1.1 MB) - added by dbevans (David B. Evans) 5 years ago.
Build log showing build failure when using ffmpeg 3.0
patch-VLC-ffmpeg-contrib.diff (4.0 KB) - added by dbevans (David B. Evans) 4 years ago.
Very rough poc patch to build a static ffmpeg using contrib
VLC-ffmpeg-revised.diff (46.3 KB) - added by dbevans (David B. Evans) 4 years ago.
Dave's revised patch against the existing VLC port in trunk
VLC-ffmpeg-yosemite.log (812.5 KB) - added by dbevans (David B. Evans) 4 years ago.
Log of second build failure on Yosemite.
VLC+ffmpeg.diff (49.4 KB) - added by RJVB (René Bertin) 4 years ago.

Download all attachments as: .zip

Change History (55)

Changed 5 years ago by dbevans (David B. Evans)

Attachment: main.log added

Build log showing build failure when using ffmpeg 3.0

comment:1 Changed 5 years ago by RJVB (René Bertin)

The newer VLC port I'm maintaining more or less actively is here: #49051

It looks that FFMpeg's build system provides all the hooks required to maintain parallel concurrent installations, up to and including the addition of a suffix to libraries and binaries. I'll try to find some time to exploit this and create a proof of concept implementation that I'll also be able to use to check VLC against FFMpeg 3 .

Last edited 4 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:2 Changed 5 years ago by RJVB (René Bertin)

So I made a PoC implementation of a port:ffmpeg-30 that uses a combination of ffmpeg's --*-suffix and --*dir configure arguments to provide an ffmpeg 3.0 installation in parallel to the main/official ffmpeg 2.8.6 installation. After patching VLC's configure.ac so it uses the suffixed libav* (etc) pkg-config scripts, it turned out that version 2.2.2 rejects ffmpeg 3.0 :

    PKG_CHECK_EXISTS([libavutil < 55],, [
      AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
    ])

one can work around that check, and the code will build without further errors, but the resulting application is crippled (won't even play MJPEG videos).

So it looks that VLC at least will remain stuck on ffmpeg 2.8 for the time being, and I'll be applying those PoC modifications to the current (2.8.6) ffmpeg port.

comment:3 Changed 5 years ago by mojca (Mojca Miklavec)

For those who understand German (or are willing to use google translate) here's a rant from a FFmpeg developer.

More thoughts on another forum.

From slashdot:

Correct, the latest stable release (VLC 2.2. 2) doesn't compile due to API changes on the FFMPEG side however the latest VLC in their Git repository works with it. I am the Gentoo proxy-maintainer for VLC, and I have looked at the changes to make VLC 2.2.x work with FFMPEG 3.0, and they're not trivial or backwards compatible. My recommendation for folks on Gentoo at least is to use VLC-9999 (the Gentoo name of the latest upstream commit) if you need FFMPEG 3.0. One other thing to note is that FFMPEG >= 2.9 also breaks hardware acceleration in VLC (i.e. vdpau or vaapi), and if you need those, either stay on FFMPEG 2.8.6 or switch to libav.

comment:4 Changed 5 years ago by mojca (Mojca Miklavec)

Description: modified (diff)
Port: VLC-devel added
Summary: VLC @2.1.5: build fails when using recently released ffmpeg-3.0VLC @2.2.2: build fails when using recently released ffmpeg-3.0
Version: 2.3.4

comment:5 Changed 5 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:6 Changed 5 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:7 in reply to:  3 Changed 5 years ago by RJVB (René Bertin)

One other thing to note is that FFMPEG >= 2.9 also breaks hardware acceleration in VLC (i.e. vdpau or vaapi)

That would give a pretty darn good reason to stick with 2.8.6 if true on OS X too.

Does anyone have an idea if this concerns only VLC or also other FFMpeg dependents (not to mention FFMpeg itself of course)?

comment:8 Changed 5 years ago by majoc-at-astro (majoc-at-astro)

Cc: majoc@… added

Cc Me!

comment:9 Changed 4 years ago by RJVB (René Bertin)

I just took another look and found a post by one of the VLC devs on their forum: it looks like FFMpeg 3 won't be supported in VLC 2.x and will come only in VLC 3.

Pushing those devs (as suggested in the main ticket) will only have adverse effects; in this case they'd even have a very valid point that it's up to the packagers to provide a compatible FFMpeg package. The latest 2.8 version in this case, as 2.9 and above break hardware acceleration support in VLC.

comment:10 in reply to:  9 Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

I just took another look and found a post by one of the VLC devs on their forum: it looks like FFMpeg 3 won't be supported in VLC 2.x and will come only in VLC 3.

Pushing those devs (as suggested in the main ticket) will only have adverse effects; in this case they'd even have a very valid point that it's up to the packagers to provide a compatible FFMpeg package. The latest 2.8 version in this case, as 2.9 and above break hardware acceleration support in VLC.

I agree pushing won't help. They have their own approach which is to settle on a specific version (specific git commit in the ffmpeg case) rather than tryiing to chase the latest version of a rapidly developing package. You can see this in their optional contrib build system. For the 2.2.x branch, the ffmpeg build rules in contrib/src/ffmpeg/rules.mak specify

HASH=cdb0225
FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz
FFMPEG_GITURL := git://git.videolan.org/ffmpeg.git
FFMPEGCONF = \
        --cc="$(CC)" \
        --pkg-config="$(PKG_CONFIG)" \
        --disable-doc \
        --disable-encoder=vorbis \
        --enable-libgsm \
        --enable-libopenjpeg \
        --disable-debug \
        --disable-avdevice \
        --disable-devices \
        --disable-avfilter \
        --disable-filters \
        --disable-protocol=concat \
        --disable-bsfs \
        --disable-bzlib \
        --enable-avresample

which corresponds to ffmpeg 2.7 + some following bug fix commits and is a much smaller stripped down version of ffmpeg than what we build. They build it (and its very few dependencies) as a private static lib so it's completely independent of other ports.

In git master they've commented out any ffmpeg version limitations and have their contrib version set to build from ffmpeg HEAD so VLC 3 should, indeed, build with ffmpeg 3.0.

At this point, ffmpeg 3.0 compatibility issues with all the other dependents have been ironed out one way or another so VLC, VLC-devel are the only two ports blocking upgrade to latest ffmpeg (now 3.0.2) and I'd like to go ahead with the upgrade.

I really don't think it's worth the effort and hassle to have a special port or subport of ffmpeg for VLC that conflicts with the version used by all the other dependent ports. Rather I suggest going with VLC's flow and build the custom static lib as part of the port for the stable version. An updated VLC-devel based on git master should build with either ffmpeg 3.0 or ffmpeg-devel although I saw a note on their wiki that they don't appreciate the distribution of binaries based on unreleased code.

Just to see if that were at all possible, I put together a patch for VLC over the weekend that does the git fetch & build of ffmpeg using their contrib build instructions. It's not pretty but it builds successfully. Beyond that it's completely untested at this point.

Or considering the upstream attitudes, maybe it would be best to just dispense with VLC on MacPorts altogether since upstream provides precompiled binaries that work fine.

Very rough patch attached.

Changed 4 years ago by dbevans (David B. Evans)

Very rough poc patch to build a static ffmpeg using contrib

comment:11 Changed 4 years ago by RJVB (René Bertin)

I'd agree to discontinue the port:VLC, but not port:libVLC which is a dependency for VLC phonon backends (at least the qt5 version should be part of my KF5 ports tree). Those are alternatives for the gstreamer backend which are much more complicated in terms of dependencies. Also, the VLC backend carries the promise that one day it will allow selection of actual audio devices through phonon (rather than just the default device). Upstream doesn't provide a libVLC that can be used as a dependency.

I'm not usually in favour of duplicating things, here VLC's buildsystem glue to pull in and build a contrib ffmpeg. However I do wonder if it wouldn't be more in line with MacPorts guidelines to trim down the current ffmpeg 2.8 port, reconfigure it to build in an appropriate location and incorporate it as a subport in port:VLC (port:ffmpeg-VLC for instance). With trimming down I of course mean aligning to the contrib build, removing all useless variants etc. The maintenance burden would be on me and/or anyone else who wishes to help out with port:VLC maintenance. That would at least have the advantage that those of us who build port:VLC or port:libVLC from source do not have to pull in and build ffmpeg each time.

comment:12 in reply to:  11 Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

I'd agree to discontinue the port:VLC, but not port:libVLC which is a dependency for VLC phonon backends (at least the qt5 version should be part of my KF5 ports tree). Those are alternatives for the gstreamer backend which are much more complicated in terms of dependencies. Also, the VLC backend carries the promise that one day it will allow selection of actual audio devices through phonon (rather than just the default device). Upstream doesn't provide a libVLC that can be used as a dependency.

I'm not usually in favour of duplicating things, here VLC's buildsystem glue to pull in and build a contrib ffmpeg. However I do wonder if it wouldn't be more in line with MacPorts guidelines to trim down the current ffmpeg 2.8 port, reconfigure it to build in an appropriate location and incorporate it as a subport in port:VLC (port:ffmpeg-VLC for instance). With trimming down I of course mean aligning to the contrib build, removing all useless variants etc. The maintenance burden would be on me and/or anyone else who wishes to help out with port:VLC maintenance. That would at least have the advantage that those of us who build port:VLC or port:libVLC from source do not have to pull in and build ffmpeg each time.

I thought about that as well. This would be a cleaner approach if you'd like to do it. I'd recommend using the structure of ffmpeg-devel as a starting point so that you can easily target a specific ffmpeg commit as the VLC folks do. Then you can adjust the licensing to reflect the particular content included. I note that they build ffmpeg with libgsm support which would need to be ported as well and possibly has some licensing issues.

If you elect to do this, I would just like to request that you install this special ffmpeg version in a unique subdirectory in the MacPorts tree so that it doesn't conflict with the stable ffmpeg version. This way people will be able to use libVLC or VLC itself without giving up having other ffmpeg dependents as well.

BTW, the same goes for VLC and libvlc. It would be nice if VLC just depended on libvlc without any conflicts and without rebuilding libvlc itself.

comment:13 Changed 4 years ago by RJVB (René Bertin)

I'll see if I can get this to work then, but most likely not before next week (and without the libgsm dependency at first).

I would just like to request that you install this special ffmpeg version in a unique subdirectory in the MacPorts tree so that it doesn't conflict with the stable ffmpeg version.

Well, that was exactly what I planned to do. Evidently the goal would be not to conflict with the "real" FFMpeg port.

As to VLC and libVLC: I've thought about that, but you've probably seen that there's no way to build just libVLC. For port:libVLC I just delete everything not related to the library in the post-destroot. There also is no way to build the rest VLC against an existing libVLC, so basically we'd be looking at a port which builds everything twice, and then throws away a considerable part of each build. That's not so much of an issue for the build bots, but with a port that has so many options there must be more than a few users even with the /opt/local prefix who end up building from source.

In case it isn't clear: port:VLC does provide libVLC, so a dependency on that library can be satisfied by either port:libVLC or port:VLC .

Last edited 4 years ago by RJVB (René Bertin) (previous) (diff)

comment:14 in reply to:  13 Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

I'll see if I can get this to work then, but most likely not before next week (and without the libgsm dependency at first).

That should work. I'll be out of the country on holiday for a month beginning the last week in May so I was hoping to get the ffmpeg 3.0.2 update out early next week to allow time for any issues to settle before I take off.

I would just like to request that you install this special ffmpeg version in a unique subdirectory in the MacPorts tree so that it doesn't conflict with the stable ffmpeg version.

Well, that was exactly what I planned to do. Evidently the goal would be not to conflict with the "real" FFMpeg port.

Indeed.

As to VLC and libVLC: I've thought about that, but you've probably seen that there's no way to build just libVLC. For port:libVLC I just delete everything not related to the library in the post-destroot. There also is no way to build the rest VLC against an existing libVLC, so basically we'd be looking at a port which builds everything twice, and then throws away a considerable part of each build. That's not so much of an issue for the build bots, but with a port that has so many options there must be more than a few users even with the /opt/local prefix who end up building from source.

In case it isn't clear: port:VLC does provide libVLC, so a dependency on that library can be satisfied by either port:libVLC or port:VLC .

Of course, no problem. What about VLC-devel? It's currently unmaintained and I'm not sure of it's value. Are you planning on updating it to the latest git master? The version you submitted in #47313 got lost in the shuffle, is out of date and should probably match whatever you're planning for VLC in structure. Or can we just nuke it?

comment:15 Changed 4 years ago by RJVB (René Bertin)

VLC-devel can indeed be nuked for the time being. I'm not even maintaining it locally for myself, which is due in large part to a lack of communication with upstream and the phonon-backend-vlc maintainer(s). I think I or someone can take it up again by forking port:VLC when we catch wind that VLC 3 is getting close to release.

comment:16 Changed 4 years ago by dbevans (David B. Evans)

VLC-devel declared obsolete replaced by VLC in r148364.

comment:17 Changed 4 years ago by RJVB (René Bertin)

Do you really think we should use the ffmpeg git version as upstream? For me things work just fine with 2.8.6 and I'm tempted to think that 2.8 should be better than 2.7 .

comment:18 Changed 4 years ago by dbevans (David B. Evans)

I just mentioned it because that is what upstream is coding to in the 2.2.* series so, from their point of view, you might have a right to ask for fixes, etc if you used it. As you say, the 2.8.6 version works fine if you override their version checks during configuration. Use probably would see more deprecation warnings with it but you also probably won't see the use of any new API introduced by it because they're working with 2.7. But we know what the issues are with using 2.8.6 are already.

It would make more difference if you were working with a newly released 3.0 for instance. In that case, to make life easier, I would advise sticking with whatever version they are using as their reference and not change it until they do.

I guess you're thinking that it would be easier to download a release tarball than a git commit but then you can always get a tarball for anything using the github ffmpeg mirror as I'm doing with ffmpeg-devel. I wouldn't use git to fetch as they do.

So I'd say pick something that works now but try to stay with their reference in the future. Make it easy on yourself. But don't expect help from upstream unless you do it their way.

comment:19 Changed 4 years ago by RJVB (René Bertin)

No, I actually thought it'd be easier to stick with something we know works for us. I have no issues whatsoever fetching from git (you may have noticed that they actually host their own fork, which means that we might even have to use that if we want to be sure to use a "ratified" ffmpeg version).

Even if VLC doesn't use any of the new APIs introduced in ffmpeg 2.8 it will should benefit from bugfixes and other improvements elsewhere. You're bound to know ffmpeg much more intimately than I do, though, so maybe that's nothing more than a rhetorical argument. I wouldn't count on help from upstream, so that's not a strong reason to stick to what they prescribe.

We'll see about ffmpeg 3. I'd *hope* that by the time VLC nears maturity it will support ffmpeg well enough to work with the official port:ffmpeg .

comment:20 Changed 4 years ago by RJVB (René Bertin)

Well, this was less work and I had a bit more time than I thought . An initial "works-for-me" draft is available at

https://github.com/RJVB/macstrop/tree/master/multimedia/VLC

Could I ask you to have a look at the ffmpeg-VLC dependency list to see if it can be pruned a bit more?

Two bits of collateral damage:

  • I had to drop opencv support, as opencv depends on ffmpeg and that would probably cause runtime issues (in addition to linker errors)
  • I didn't manage to tell the linker to use the libraries in ${prefix}/lib/vlc/ffmpeg/lib rather than in ${prefix}/lib . The pkg-config file is set up correctly though, so I guess the only solution would be to patch the build system to use absolute paths rather than -lfoo arguments. A bit over the top, I've simply registered a build conflict.

comment:21 in reply to:  20 ; Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

Well, this was less work and I had a bit more time than I thought . An initial "works-for-me" draft is available at

https://github.com/RJVB/macstrop/tree/master/multimedia/VLC

Could I ask you to have a look at the ffmpeg-VLC dependency list to see if it can be pruned a bit more?

Yes, I think it can be. ffmpeg is designed to build the base functionality without using any external libs at all and functionality based on external libs is disabled by default in general and must be explicitly enabled if desired.

The VLC contrib build of ffmpeg only enables the following:

  • lame
  • openjpeg
  • libgsm
  • libvpx

Your configuration seems to be consistent with this (less libgsm) but there are extra dependencies that are probably not doing any good since they're not enabled. You should remove the following dependencies:

                    port:libvorbis \
                    port:libopus \
                    port:libogg \
                    port:libtheora \
                    port:libass \

Also the following additional configuration items and corresponding dependencies

                    --enable-libx264 \
                    --enable-libxvid
depends_lib-append  port:XviD \
                    port:x264

Most of these are supported directly by VLC without using ffmpeg

Two bits of collateral damage:

  • I had to drop opencv support, as opencv depends on ffmpeg and that would probably cause runtime issues (in addition to linker errors)

To avoid any linking issues/conflicts I would do as VLC does in the contrib build and build static libraries only.

--disable-shared --enable-static
  • I didn't manage to tell the linker to use the libraries in ${prefix}/lib/vlc/ffmpeg/lib rather than in ${prefix}/lib . The pkg-config file is set up correctly though, so I guess the only solution would be to patch the build system to use absolute paths rather than -lfoo arguments. A bit over the top, I've simply registered a build conflict.

Did you try appending -L${prefix}/lib/vlc/ffmpeg/lib to LDFLAGS?

comment:22 Changed 4 years ago by dbevans (David B. Evans)

You can also remove the following dependencies because they are not enabled:

                    port:gnutls \
                    port:fontconfig \
                    port:freetype \
                    port:bzip2

comment:23 in reply to:  21 ; Changed 4 years ago by RJVB (René Bertin)

Replying to devans@…:

You should remove the following dependencies:

                    port:libvorbis \
                    port:libopus \
                    port:libogg \
                    port:libtheora \
                    port:libass \

I left those in because I saw the corresponding entries show up in the list of supported codecs and containers that is printed after the configure step, and I don't know exactly for what VLC uses ffmpeg.

Most of these are supported directly by VLC without using ffmpeg

Including x264 (H.264 compression) and XviD, or anything text related that could benefit from freetype/fontconfig?

To avoid any linking issues/conflicts I would do as VLC does in the contrib build and build static libraries only.

--disable-shared --enable-static

I'd like to try to use shared libraries, to give the subport the maximum raison d'être. There are 4 or 5 modules that link to ffmpeg libraries.

Anyway, I'll try, but I'm not convinced that it'll help:

Did you try appending -L${prefix}/lib/vlc/ffmpeg/lib to LDFLAGS?

No, because that argument is already added where required (I checked, but otherwise the link would simply fail). I think the issue is that there is also a -L${prefix}/lib argument which cannot be omitted. It's not the first time I'm dealing with this kind of issue (for libraries or headers). What I should check is the possibility of editing the .pc file so that it outputs the absolute paths to the library binaries rather than using -Lfoo -lbar.

comment:24 in reply to:  23 ; Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

Replying to devans@…:

You should remove the following dependencies:

                    port:libvorbis \
                    port:libopus \
                    port:libogg \
                    port:libtheora \
                    port:libass \

I left those in because I saw the corresponding entries show up in the list of supported codecs and containers that is printed after the configure step, and I don't know exactly for what VLC uses ffmpeg.

None of them are enabled in your configuration so won't be used by ffmpeg. Looking at the VLC code, it has its own modules for these under modules/codec. VLC uses ffmpeg in modules/codec/avcodec for support of basic mpeg audio and video streams. VLC may need these dependencies but not via ffmpeg. See

modules/codec/ogg.c
modules/codec/opus.c
modules/codec/vorbis.c
modules/codec/theora.c
...

Most of these are supported directly by VLC without using ffmpeg

Including x264 (H.264 compression) and XviD, or anything text related that could benefit from freetype/fontconfig?

Yes, for instance

modules/codec/x264.c

In ffmpeg, freetype/fontconfig are only used (if enabled) in the drawtext filter which draws text on video frames. VLC doesn't use ffmpeg filters or libavfilter (not enabled in ffmpeg contrib build).

To avoid any linking issues/conflicts I would do as VLC does in the contrib build and build static libraries only.

--disable-shared --enable-static

I'd like to try to use shared libraries, to give the subport the maximum raison d'être. There are 4 or 5 modules that link to ffmpeg libraries.

Anyway, I'll try, but I'm not convinced that it'll help:

Did you try appending -L${prefix}/lib/vlc/ffmpeg/lib to LDFLAGS?

No, because that argument is already added where required (I checked, but otherwise the link would simply fail). I think the issue is that there is also a -L${prefix}/lib argument which cannot be omitted. It's not the first time I'm dealing with this kind of issue (for libraries or headers). What I should check is the possibility of editing the .pc file so that it outputs the absolute paths to the library binaries rather than using -Lfoo -lbar.

You might look at how the ffmpeg contrib build does this. They fix up the .pc files as part of this build.

Last edited 4 years ago by dbevans (David B. Evans) (previous) (diff)

comment:25 in reply to:  24 Changed 4 years ago by RJVB (René Bertin)

Replying to devans@…:

None of them are enabled in your configuration so won't be used by ffmpeg. Looking at the VLC code, it has its own modules for these

I find myself being extremely lazy not checking this in depth (must be the summery weather). Curious though that the config summary shows them being enabled. I think it must be because quite a few options auto-activate when their dependencies are detected, and I of course have those installed.

Yes, for instance

modules/codec/x264.c

That was a stupid question actually. I know (or at least I think so :)) that x264 is a videolan project. It'd stand to reason they include native support for it ...

You might look at how the ffmpeg contrib build does this. They fix up the .pc files as part of this build.

Where did you see that? I've tried the contrib build, and I get .pc files that contain -L${libdir} -lfoo. They may include the private libraries on the same line, though, but that's not a relevant change AFAICS. I've changed my own .pc files to contain Libs: ${libdir}/libfoo.dylib, but that doesn't work:

> cd .../vlc-2.2.2/modules/ ; ../doltlibtool -v --tag=CC --mode=link /usr/bin/clang -I/opt/local/lib/vlc/ffmpeg/include -O3 -march=native -g -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -avoid-version -module -export-symbols-regex '^vlc_entry' -no-undefined ../compat/libcompat.la ../src/libvlccore.la -rpath '/opt/local/lib/vlc/plugins/video_chroma' -L/opt/local/lib -Wl,-headerpad_max_install_names -L/opt/local/lib/samba3 -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/lib -o libswscale_plugin.la video_chroma/libswscale_plugin_la-swscale.lo codec/avcodec/libswscale_plugin_la-chroma.lo /opt/local/lib/vlc/ffmpeg/lib/libswscale.3.1.101.dylib -lm /opt/local/lib/vlc/ffmpeg/lib/libavutil.54.31.100.dylib -lm
/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/modules
+ false
+ exec ../libtool -v --tag=CC --mode=link /usr/bin/clang -I/opt/local/lib/vlc/ffmpeg/include -O3 -march=native -g -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -avoid-version -module -export-symbols-regex '^vlc_entry' -no-undefined ../compat/libcompat.la ../src/libvlccore.la -rpath /opt/local/lib/vlc/plugins/video_chroma -L/opt/local/lib -Wl,-headerpad_max_install_names -L/opt/local/lib/samba3 -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/lib -o libswscale_plugin.la video_chroma/libswscale_plugin_la-swscale.lo codec/avcodec/libswscale_plugin_la-chroma.lo /opt/local/lib/vlc/ffmpeg/lib/libswscale.3.1.101.dylib -lm /opt/local/lib/vlc/ffmpeg/lib/libavutil.54.31.100.dylib -lm
libtool: link: rm -fr  .libs/libswscale_plugin.exp
libtool: link: generating symbol list for 'libswscale_plugin.la'
libtool: link: /opt/local/bin/nm  video_chroma/.libs/libswscale_plugin_la-swscale.o codec/avcodec/.libs/libswscale_plugin_la-chroma.o   | sed -n -e 's/^.*[      ]\([BCDEGRST][BCDEGRST]*\)[     ][      ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d' | /opt/local/bin/gsed 's/.* //' | sort | uniq > .libs/libswscale_plugin.exp
libtool: link: /opt/local/bin/grep -E -e "^vlc_entry" ".libs/libswscale_plugin.exp" > ".libs/libswscale_plugin.expT"
libtool: link: mv -f ".libs/libswscale_plugin.expT" ".libs/libswscale_plugin.exp"
libtool: link: sed -e 's|^|_|' < .libs/libswscale_plugin.exp > .libs/libswscale_plugin-symbols.expsym
libtool: link: /usr/bin/clang  -o .libs/libswscale_plugin.so -bundle  video_chroma/.libs/libswscale_plugin_la-swscale.o codec/avcodec/.libs/libswscale_plugin_la-chroma.o   ../compat/.libs/libcompat.a -L/opt/local/lib -L/opt/local/lib/samba3 -L/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC/VLC/work/vlc-2.2.2/contrib/lib ../src/.libs/libvlccore.dylib -lintl -lidn -liconv -ldbus-1 -lm  -O3 -march=native -g -arch x86_64 -O3 -Wl,-headerpad_max_install_names -arch x86_64 -Wl,-headerpad_max_install_names   -Wl,-exported_symbols_list,.libs/libswscale_plugin-symbols.expsym
Undefined symbols for architecture x86_64:

somewhere in the libtool script the .dylib link modules get lost, and I haven't yet understood where that happens, or why.

comment:26 Changed 4 years ago by RJVB (René Bertin)

Actually:

> otool -L `port work VLC-test`/vlc-2.2.2//VLC.app/Contents/MacOS/plugins/libswscale_plugin.dylib 
/opt/local/var/macports/build/_opt_local_site-ports_multimedia_VLC-test/VLC-test/work/vlc-2.2.2//VLC.app/Contents/MacOS/plugins/libswscale_plugin.dylib:
        @loader_path/../lib/libvlccore.8.dylib (compatibility version 9.0.0, current version 9.0.0)
        /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.3.0)
        /opt/local/lib/libidn.11.dylib (compatibility version 18.0.0, current version 18.12.0)
        /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current version 8.1.0)
        /opt/local/lib/libdbus-1.3.dylib (compatibility version 18.0.0, current version 18.6.0)
        /opt/local/lib/libswscale-2.3.dylib (compatibility version 3.0.0, current version 3.1.101)
        /opt/local/lib/libavutil-2.54.dylib (compatibility version 54.0.0, current version 54.31.100)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

That's after the build step, with port:VLC-test a test port created by applying your patch to port:VLC from the official port tree (which is missing a patch file, btw). Evidently the plugin still depends on the installed shared library from port:ffmpeg after the destroot step.

Did you verify this on your end?!

comment:27 Changed 4 years ago by RJVB (René Bertin)

I've found a workaround, a bit of a kludge: let the .dylibs masquerade as .o files via symlinks to trick libtool into not filtering them out. The compiler isn't fooled and treats them correctly, which leads to the intended result. Edit: pushed to git

Last edited 4 years ago by RJVB (René Bertin) (previous) (diff)

comment:28 Changed 4 years ago by RJVB (René Bertin)

I pushed a new update that has a more elegant workaround. ffmpeg-VLC now builds using --build-suffix=-VLC, meaning all generated libraries now have a -VLC suffix. That evidently shows up in the .pc files too; the only not-so-nice fix that remains to be done is renaming the .pc files to remove the -VLC suffix from them (or rather, install symlinks making them available both with and without the prefix).

David: can you have another look please? I don't plan to keep the ffmpeg-VLC subport in a separate file, evidently, but prefer that as long as I still need to tweak it.

comment:29 Changed 4 years ago by dbevans (David B. Evans)

Has duplicate #51476

comment:30 in reply to:  28 Changed 4 years ago by dbevans (David B. Evans)

Replying to rjvbertin@…:

David: can you have another look please? I don't plan to keep the ffmpeg-VLC subport in a separate file, evidently, but prefer that as long as I still need to tweak it.

Will take a look today but you really need to pose your update as a unified diff against the current version in subversion.

comment:31 Changed 4 years ago by RJVB (René Bertin)

Reason I didn't do that until now is that it only makes sense with a single Portfile instead of the split-up contraption I've been using to avoid getting confused about what aspect I was editing ;)

comment:32 Changed 4 years ago by Schamschula (Marius Schamschula)

Cc: mps@… added

Cc Me!

comment:33 Changed 4 years ago by dbevans (David B. Evans)

OK, copied VLC from trunk to my local test repo and applied your patch successfully. Now I just need to get Portfile.ffmpeg.tcl.

comment:34 Changed 4 years ago by RJVB (René Bertin)

Oh damn, my bad. I edited one copy of the Portfile to include that "ffmpeg sub Portfile", and then generated the diff with another copy...

comment:35 Changed 4 years ago by dbevans (David B. Evans)

Cc: jeremyhu@… added

comment:36 Changed 4 years ago by dbevans (David B. Evans)

Some progress but no cigar as yet! Here's my experience trying to build on Yosemite (10.10.5) Xcode 7.2.1

First to make things work at all I needed to make a few modifications

  • the ffmpeg-VLC subport needs
    PortGroup               xcodeversion 1.0
    

up with the others at the top.

  • although the ffmpeg-VLC subport is now included in the main Portfile, patch-static_assert.diff was still missing from the files directory. I grabbed a copy from your github repo and things started to work.

The ffmpeg-VLC subport builds fine but I'm not too excited about installing it in the /opt/local tree. IMO, it should be treated as a private library and not be visible outside of the VLC build environment. To do this, you need to build static libraries and install them with include files and pkg-config files in a convenient directory in the build tree. (Could even be contrib, for instance). Then you just need to adjust your configuration so the build will find it. Don't see any need for any of these files to be visible after the build is complete.

For an example of another port that does something very similar see gimp-gap-devel.

VLC then configured properly but initially failed at post-configure due to the missing patch file. After adding the file things proceeded.

The build was looking good and I was getting my hopes up when the whole thing blew up with sandbox issues when building the macosx bits

cd ./extras/package/macosx; cp -R Resources README.MacOSX.rtf /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/
mkdir -p /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/vlc.xcodeproj/
sed -e s,../../../contrib,/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib,g ./extras/package/macosx/vlc.xcodeproj/project.pbxproj \
        > /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/vlc.xcodeproj/project.pbxproj
REVISION=`(git --git-dir=./.git describe --always || echo exported)` && \
	    sed "s/#REVISION#/$REVISION/g" ./extras/package/macosx/Info.plist \
        > ./tmp/extras/package/macosx/Info.plist
fatal: Not a git repository: './.git'
xcrun plutil -convert binary1 ./tmp/extras/package/macosx/Info.plist
cp -R ./extras/package/macosx/Resources ./tmp/extras/package/macosx/
cd "."; cp AUTHORS COPYING THANKS /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/
mkdir -p ./tmp/modules/audio_output
mkdir -p ./tmp/modules/gui/macosx
cd "./modules/gui/macosx/" && cp *.h *.m /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/modules/gui/macosx/
cd ./tmp/extras/package/macosx && \
		xcodebuild -target vlc SYMROOT=../../../build DSTROOT=../../../build 
Build settings from command line:
    DSTROOT = ../../../build
    SYMROOT = ../../../build

Could not find service "com.apple.CoreSimulator.CoreSimulatorService" in domain for uid: 502
2016-05-23 13:32:25.947 xcodebuild[80538:116712] launchctl print returned an error code: 28928
2016-05-23 13:32:25.948 xcodebuild[80538:116712] Failed to locate a valid instance of CoreSimulatorService in the bootstrap.  Adding it now.
Could not find service "com.apple.CoreSimulator.CoreSimulatorService" in domain for uid: 502
2016-05-23 13:32:26.869 xcodebuild[80538:116712] launchctl print returned an error code: 28928
2016-05-23 13:32:26.869 xcodebuild[80538:116712] *** Assertion failure in -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreSimulator/CoreSimulator-201.3/CoreSimulator/SimServiceContext.m:451
** INTERNAL ERROR: Uncaught exception **
Exception: Unable to lookup com.apple.CoreSimulator.CoreSimulatorService in the bootstrap.  This can happen if running with a sandbox profile.  When running with a sandbox profile, make sure that com.apple.CoreSimulator.CoreSimulatorService.xpc is owned by root, not group writable, and not world writable.  See <rdar://problem/22142915>.
Stack:
=== BUILD TARGET vlc OF PROJECT vlc WITH THE DEFAULT CONFIGURATION (Default) ===

Check dependencies

Write auxiliary files
write-file /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/vlc.build/Default/vlc.build/VLC.hmap

Create product structure
/bin/mkdir -p /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents
/bin/mkdir -p /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources

CopyStringsFile /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources/English.lproj/InfoPlist.strings Resources/English.lproj/InfoPlist.strings
    cd /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx
    builtin-copyStrings --validate --inputencoding iso-8859-1 --outputencoding UTF-16 --outdir /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources/English.lproj -- Resources/English.lproj/InfoPlist.strings

CpResource Resources/dsa_pub.pem /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources/dsa_pub.pem
    cd /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/Resources/dsa_pub.pem /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources

CpResource Resources/mainwindow_dark/titlebar/yosemite/yosemite-window-minimize@2x.png /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources/yosemite-window-minimize@2x.png
    cd /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/Resources/mainwindow_dark/titlebar/yosemite/yosemite-window-minimize@2x.png /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources

CompileXIB Resources/English.lproj/AddonManager.xib
    cd /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx
    export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode-7.2/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode-7.2/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --plugin /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib/BGHUDAppKit.framework/Resources/BGHUDAppKitPlugin.ibplugin --module VLC --output-partial-info-plist /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/vlc.build/Default/vlc.build/AddonManager-PartialInfo.plist --auto-activate-custom-fonts --target-device mac --minimum-deployment-target 10.11 --output-format human-readable-text --compile /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/build/Default/VLC.bundle/Contents/Resources/English.lproj/AddonManager.nib /opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/tmp/extras/package/macosx/Resources/English.lproj/AddonManager.xib
  0  0x00007fff8970a024 __exceptionPreprocess (in CoreFoundation)
  1  0x00007fff8ca2676e objc_exception_throw (in libobjc.A.dylib)
  2  0x00007fff89709e1a +[NSException raise:format:arguments:] (in CoreFoundation)
  3  0x00007fff8d6d599b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] (in Foundation)
  4  0x000000011175f2e5 -[SimServiceContext reloadServiceIfMovedOrAbortIfWeAreInvalid] (in CoreSimulator)
  5  0x000000011175fc03 -[SimServiceContext connect] (in CoreSimulator)
  6  0x000000011175e8bc -[SimServiceContext initWithConnectionType:] (in CoreSimulator)
  7  0x000000011175e41a +[SimServiceContext simContextWithConnectionType:] (in CoreSimulator)
  8  0x000000011175e3cb __41+[SimServiceContext sharedServiceContext]_block_invoke (in CoreSimulator)
  9  0x00007fff8d5e3e73 _dispatch_client_callout (in libdispatch.dylib)
 10  0x00007fff8d5e3d86 dispatch_once_f (in libdispatch.dylib)
 11  0x000000011175e3a9 +[SimServiceContext sharedServiceContext] (in CoreSimulator)
 12  0x000000011177e41a +[SimDeviceSet setForSetPath:] (in CoreSimulator)
 13  0x000000011177e3b6 +[SimDeviceSet defaultSet] (in CoreSimulator)
 14  0x000000011509cfe0 __42-[DVTiPhoneSimulatorLocator startLocating]_block_invoke (in IDEiOSSupportCore)
 15  0x000000010b6b1a58 __DVTDispatchAsync_block_invoke (in DVTFoundation)
 16  0x00007fff8d5e7700 _dispatch_call_block_and_release (in libdispatch.dylib)
 17  0x00007fff8d5e3e73 _dispatch_client_callout (in libdispatch.dylib)
 18  0x00007fff8d5e6dc7 _dispatch_root_queue_drain (in libdispatch.dylib)
 19  0x00007fff8d5e6a1c _dispatch_worker_thread3 (in libdispatch.dylib)
 20  0x00007fff87451a9d _pthread_wqthread (in libsystem_pthread.dylib)
 21  0x00007fff8744f3dd start_wqthread (in libsystem_pthread.dylib)

/bin/sh: line 1: 80538 Abort trap: 6           xcodebuild -target vlc SYMROOT=../../../build DSTROOT=../../../build
make[2]: *** [VLC-tmp] Error 134
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3'
Command failed:  cd "/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3" && /usr/bin/make -j4 -w all DESTDIR=/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/dest_ignore V=1 
Exit code: 2

And that's as far as I got.

As I mentioned on the various lists a while ago, I'm going on vacation for a month and so this is about as far as I can go with this for now. I'm referring this to Jeremy Huddleston (jeremyhu) to pick up where I left off. He's a good choice as he knows a good deal more about VLC than I do as he a previous maintainer of the port. The static assert issue is one that he worked on before as well so he have more insight there as well.

Shouldn't take too much more to whip this one into shape with ffmpeg as a private library. Looks like you've done a lot of work.

I'll post my updated copy of the patch relative to the current version and also the full build log for VLC.

Changed 4 years ago by dbevans (David B. Evans)

Attachment: VLC-ffmpeg-revised.diff added

Dave's revised patch against the existing VLC port in trunk

comment:37 Changed 4 years ago by dbevans (David B. Evans)

Attached my patchfile with the two minor changes I mentioned above.

I got called away and just got back to this and found that I had inadvertantly erase the previous log file without saving it. So cleaned the port and tried again. This time I got an entirely different and undesireable set of errors:

../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..  -DMODULE_STRING=\"$(p="codec/avcodec/libavcodec_plugin_la-audio.lo"; p="${p##*/}"; p="${p#lib}"; p="${p%_plugin*}"; p="${p%.lo}"; echo "$p")\" -D__PLUGIN__  -I./access -I./codec -I../include -I../include -I/opt/local/include -D__unix__=1 -I/opt/local/lib/live/liveMedia/include -I/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib/include -I/opt/local/lib/vlc/ffmpeg/include  -I/opt/local/lib/vlc/ffmpeg/include  -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -MT codec/avcodec/libavcodec_plugin_la-audio.lo -MD -MP -MF codec/avcodec/.deps/libavcodec_plugin_la-audio.Tpo -c -o codec/avcodec/libavcodec_plugin_la-audio.lo `test -f 'codec/avcodec/audio.c' || echo './'`codec/avcodec/audio.c
codec/avcodec/subtitle.c:223:45: warning: 'pict' is deprecated [-Wdeprecated-declarations]
            const uint8_t index = ffregion->pict.data[0][y * ffregion->w+x];
                                            ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
codec/avcodec/subtitle.c:223:50: warning: 'data' is deprecated [-Wdeprecated-declarations]
            const uint8_t index = ffregion->pict.data[0][y * ffregion->w+x];
                                                 ^
/opt/local/include/libavcodec/avcodec.h:3668:14: note: 'data' has been explicitly marked deprecated here
    uint8_t *data[AV_NUM_DATA_POINTERS];    ///< pointers to the image data planes
             ^
codec/avcodec/subtitle.c:227:39: warning: 'pict' is deprecated [-Wdeprecated-declarations]
            memcpy(&color, &ffregion->pict.data[1][4*index], 4);
                                      ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
codec/avcodec/subtitle.c:227:44: warning: 'data' is deprecated [-Wdeprecated-declarations]
            memcpy(&color, &ffregion->pict.data[1][4*index], 4);
                                           ^
/usr/include/secure/_string.h:65:33: note: expanded from macro 'memcpy'
  __builtin___memcpy_chk (dest, src, len, __darwin_obsz0 (dest))
                                ^
/opt/local/include/libavcodec/avcodec.h:3668:14: note: 'data' has been explicitly marked deprecated here
    uint8_t *data[AV_NUM_DATA_POINTERS];    ///< pointers to the image data planes
             ^
codec/avcodec/subtitle.c:290:9: warning: 'avpicture_free' is deprecated [-Wdeprecated-declarations]
        avpicture_free(&rec->pict);
        ^
/opt/local/include/libavcodec/avcodec.h:4877:6: note: 'avpicture_free' has been explicitly marked deprecated here
void avpicture_free(AVPicture *picture);
     ^
codec/avcodec/subtitle.c:290:30: warning: 'pict' is deprecated [-Wdeprecated-declarations]
        avpicture_free(&rec->pict);
                             ^
/opt/local/include/libavcodec/avcodec.h:3710:15: note: 'pict' has been explicitly marked deprecated here
    AVPicture pict;
              ^
mv -f codec/.deps/libvorbis_plugin_la-vorbis.Tpo codec/.deps/libvorbis_plugin_la-vorbis.Plo
../doltlibtool  --tag=CC   --mode=compile /usr/bin/clang -DHAVE_CONFIG_H -I. -I..  -DMODULE_STRING=\"$(p="codec/avcodec/libavcodec_plugin_la-fourcc.lo"; p="${p##*/}"; p="${p#lib}"; p="${p%_plugin*}"; p="${p%.lo}"; echo "$p")\" -D__PLUGIN__  -I./access -I./codec -I../include -I../include -I/opt/local/include -D__unix__=1 -I/opt/local/lib/live/liveMedia/include -I/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib/include -I/opt/local/lib/vlc/ffmpeg/include  -I/opt/local/lib/vlc/ffmpeg/include  -DMERGE_FFMPEG -pipe -Os -arch x86_64 -D_INTL_REDIRECT_MACROS -I/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/contrib/include -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -pipe -fvisibility=hidden -O3 -ffast-math -funroll-loops -fomit-frame-pointer -MT codec/avcodec/libavcodec_plugin_la-fourcc.lo -MD -MP -MF codec/avcodec/.deps/libavcodec_plugin_la-fourcc.Tpo -c -o codec/avcodec/libavcodec_plugin_la-fourcc.lo `test -f 'codec/avcodec/fourcc.c' || echo './'`codec/avcodec/fourcc.c
codec/avcodec/video.c:237:23: error: implicit declaration of function 'avcodec_alloc_frame' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    p_sys->p_ff_pic = avcodec_alloc_frame();
                      ^
codec/avcodec/video.c:237:21: warning: incompatible integer to pointer conversion assigning to 'AVFrame *' (aka 'struct AVFrame *') from 'int' [-Wint-conversion]
    p_sys->p_ff_pic = avcodec_alloc_frame();
                    ^ ~~~~~~~~~~~~~~~~~~~~~
codec/avcodec/video.c:319:34: warning: incompatible pointer types assigning to 'enum AVPixelFormat (*)(struct AVCodecContext *, const enum AVPixelFormat *)' from 'enum PixelFormat (AVCodecContext *, const enum PixelFormat *)' [-Wincompatible-pointer-types]
    p_sys->p_context->get_format = ffmpeg_GetFormat;
                                 ^ ~~~~~~~~~~~~~~~~
codec/avcodec/video.c:449:9: error: implicit declaration of function 'avcodec_free_frame' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        avcodec_free_frame( &p_sys->p_ff_pic );
        ^
codec/avcodec/video.c:1316:25: error: incomplete result type 'enum PixelFormat' in function definition
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
                        ^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1328:30: error: subscript of pointer to incomplete type 'const enum PixelFormat'
    for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
                       ~~~~~~^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1330:67: error: subscript of pointer to incomplete type 'const enum PixelFormat'
        const AVPixFmtDescriptor *dsc = av_pix_fmt_desc_get(pi_fmt[i]);
                                                            ~~~~~~^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1336:51: error: subscript of pointer to incomplete type 'const enum PixelFormat'
                 hwaccel ? "hard" : "soft", pi_fmt[i], dsc->name );
                                            ~~~~~~^
../include/vlc_messages.h:78:63: note: expanded from macro 'msg_Dbg'
    vlc_Log( VLC_OBJECT(p_this), VLC_MSG_DBG,  MODULE_STRING, __VA_ARGS__ )
                                                              ^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1355:30: error: subscript of pointer to incomplete type 'const enum PixelFormat'
    for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
                       ~~~~~~^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1357:36: error: subscript of pointer to incomplete type 'const enum PixelFormat'
        if( p_va->pix_fmt != pi_fmt[i] )
                             ~~~~~~^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1381:22: error: subscript of pointer to incomplete type 'const enum PixelFormat'
        return pi_fmt[i];
               ~~~~~~^
codec/avcodec/video.c:111:13: note: forward declaration of 'enum PixelFormat'
static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
            ^
codec/avcodec/video.c:1389:51: warning: incompatible pointer types passing 'const enum PixelFormat *' to parameter of type 'const enum AVPixelFormat *' [-Wincompatible-pointer-types]
    return avcodec_default_get_format( p_context, pi_fmt );
                                                  ^~~~~~
/opt/local/include/libavcodec/avcodec.h:5010:100: note: passing argument to parameter 'fmt' here
enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
                                                                                                   ^
codec/avcodec/video.c:1389:12: error: returning 'enum AVPixelFormat' from a function with incompatible result type 'enum PixelFormat'
    return avcodec_default_get_format( p_context, pi_fmt );
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings and 10 errors generated.
6 warnings generated.
In file included from codec/avcodec/audio.c:42:
/opt/local/lib/vlc/ffmpeg/include/libavutil/audioconvert.h:4:5: warning: 'FF_API_AUDIOCONVERT' is not defined, evaluates to 0 [-Wundef]
#if FF_API_AUDIOCONVERT
    ^
make[4]: *** [codec/avcodec/libavcodec_plugin_la-video.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
mv -f codec/avcodec/.deps/libavcodec_plugin_la-subtitle.Tpo codec/avcodec/.deps/libavcodec_plugin_la-subtitle.Plo
1 warning generated.
mv -f codec/avcodec/.deps/libavcodec_plugin_la-audio.Tpo codec/avcodec/.deps/libavcodec_plugin_la-audio.Plo
mv -f codec/avcodec/.deps/libavcodec_plugin_la-fourcc.Tpo codec/avcodec/.deps/libavcodec_plugin_la-fourcc.Plo
make[4]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/modules'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/modules'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3'
Command failed:  cd "/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3" && /usr/bin/make -j4 -w all DESTDIR=/opt/local/var/macports/build/_Users_devans_macports_dports_multimedia_VLC/VLC/work/vlc-2.2.3/dest_ignore V=1 
Exit code: 2

These errors are symptomatic of linking with ffmpeg 3.0.2 rather than the private 2.8.6. Will try and attach this log file without erasing it! Have no idea what changed.

Changed 4 years ago by dbevans (David B. Evans)

Attachment: VLC-ffmpeg-yosemite.log added

Log of second build failure on Yosemite.

comment:38 Changed 4 years ago by RJVB (René Bertin)

In fact it looks like the build is picking up *header* files from the official/3.x port, for about the same reasons the linker used to pick up libraries from that port. Annoying, apparently --build-suffix doesn't change the header install locations. I'll have to see what I can do about that because this is usually pretty complicated; might require a set of reinplaces on the headers in the post-destroot.

Now, as to using shared libraries installed somewhere in a hidden place under ${prefix} ... I thought I'd explained why I considered that the way to go, before I went there - and that I didn't get any objections. Yes, the libraries aren't invisible, but the chances that another port will pick them up by accident are small. I could make them exceedingly small by creating the libav*.pc etc. symlinks in the VLC pre-configure. In that case, ports would not only have to instruct pkgconfig to look in the right location, the configure system would also have to request packages with the -VLC suffix.

Or I can go one step further and bundle everything required to build against ffmpeg-VLC into a tarball to be unbundled somewhere under the parent work.dir in VLC's pre-configure. I think I'm going to explore that idea.

Changed 4 years ago by RJVB (René Bertin)

Attachment: VLC+ffmpeg.diff added

comment:39 Changed 4 years ago by RJVB (René Bertin)

I've not (yet) implemented the idea of installing port:ffmpeg-VLC with a kind of implicit -dev package bundled into a tarball. I've just renamed all ${prefix}/lib/vlc/ffmpeg/include/libfoo to ${prefix}/lib/vlc/ffmpeg/include/libfoo-VLC, and added reinplace loops in post-patch to ffmpeg-VLC and VLC itself to make sure the headers are searched for in their new locations.

I think this already makes it extremely unlikely that any other port will ever use port:ffmpeg-VLC by accident. I'd still have to do all this for a contrib-style build, in order to avoid picking up ffmpeg 3.x headers or libraries. Given that we're talking about a temporary fix anyway I really am not very motivated to spend much more time. The "upcoming" VLC 3 will again use shared ffmpeg libs from ${prefix}/lib, and the transition back to that should be (a bit) easier from a build that uses shared libraries from another location.

comment:40 Changed 4 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:41 Changed 4 years ago by vit0rg

Cc: vitorg@… added

Cc Me!

comment:42 Changed 4 years ago by mklein-de (Michael Klein)

Cc: michael.klein@… added

Cc Me!

comment:43 Changed 4 years ago by michaellass (Michael Lass)

Cc: bevan@… added

Cc Me!

comment:44 Changed 4 years ago by khepler

Cc: khepler@… added

Cc Me!

comment:45 Changed 4 years ago by AlD (Daniel Albers)

Cc: daniel@… added

Cc Me!

comment:46 Changed 4 years ago by ryandesign (Ryan Schmidt)

Cc: ojkastl added

Has duplicate #52853.

comment:47 Changed 4 years ago by RJVB (René Bertin)

Cf. this pull request currently under review: https://github.com/macports/macports-ports/pull/27

comment:48 Changed 4 years ago by mkae (Marko Käning)

This also affects avahi although I don't see how, as it is not dependent on VLC.

Last edited 4 years ago by mkae (Marko Käning) (previous) (diff)

comment:49 Changed 4 years ago by RJVB (René Bertin)

Not even recursively as far as I can tell.

comment:50 Changed 4 years ago by mkae (Marko Käning)

Resolution: fixed
Status: newclosed

This was fixed with above PR.

Note: See TracTickets for help on using tickets.