LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-17-2022, 02:07 PM   #1
lecramyajiv
Member
 
Registered: Jul 2015
Distribution: Slackware64
Posts: 30

Rep: Reputation: Disabled
FFmpeg 4.4.1 compilation error with Lensfun and other issues in slackware64 15.0


I have installed Slackware 15.0 64 bit. I am trying to recompile ffmpeg 4.4.1 to support more options, the problematic options are opencv, lensfun and glslang.

When I try to compile with with --enable-opencv it gives the error: opencv not found using pkg-config.I've added the location of opencv4.pc to the $PATH but it still fails. I've only found some couple links but not any answer to this problem.

https://trac.ffmpeg.org/ticket/7608
https://www.linuxquestions.org/quest...cv-4175645720/

Coming to lensfun, I'm using lensfun verison 0.3.95. FFmpeg 4.4.1 detects it during configure but during compilation it gives the following error

Code:
In file included from libavfilter/vf_lensfun.c:40:
/usr/include/lensfun/lensfun.h:3102:41: note: expected ‘const lfLens *’ but argument is of type ‘int’
 3102 |     lfModifier *modifier, const lfLens* lens, float focal, lfLensType target_projection);
      |                           ~~~~~~~~~~~~~~^~~~
libavfilter/vf_lensfun.c:234:17: error: too few arguments to function ‘lf_modifier_enable_projection_transform’
  234 |                 lf_modifier_enable_projection_transform(lensfun->modifier, lensfun->target_geometry);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from libavfilter/vf_lensfun.c:40:
/usr/include/lensfun/lensfun.h:3101:17: note: declared here
 3101 | LF_EXPORT cbool lf_modifier_enable_projection_transform (
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_lensfun.c:238:17: error: too few arguments to function ‘lf_modifier_enable_tca_correction’
  238 |                 lf_modifier_enable_tca_correction(lensfun->modifier);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from libavfilter/vf_lensfun.c:40:
/usr/include/lensfun/lensfun.h:3094:15: note: declared here
 3094 | LF_EXPORT int lf_modifier_enable_tca_correction (lfModifier *modifier, const lfLens* lens, float focal);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [ffbuild/common.mak:67: libavfilter/vf_lensfun.o] Error 1
I found this link for lensfun again no solutions to it,
https://trac.ffmpeg.org/ticket/9112

when trying it with ffmpeg 5.0 it gives the following error

Code:
libavfilter/vf_lensfun.c:234:17: error: implicit declaration of function ‘lf_modifier_enable_projection_transform’ [-Werror=implicit-function-declaration]
  234 |                 lf_modifier_enable_projection_transform(lensfun->modifier, lensfun->target_geometry);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_lensfun.c:235:17: error: implicit declaration of function ‘lf_modifier_enable_scaling’ [-Werror=implicit-function-declaration]
  235 |                 lf_modifier_enable_scaling(lensfun->modifier, lensfun->scale);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_lensfun.c:238:17: error: implicit declaration of function ‘lf_modifier_enable_tca_correction’ [-Werror=implicit-function-declaration]
  238 |                 lf_modifier_enable_tca_correction(lensfun->modifier);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make: *** [ffbuild/common.mak:67: libavfilter/vf_lensfun.o] Error 1
In Debian and Arch, there seems to be no problem with enabling lensfun.

when enabling libglslang it gives an error libglslang not found. I have installed glslang version 11.8.0 but curiously libglslang gets detected in ffmpeg 5.0 and compiles with no problem but not in ffmpeg 4.4.1.

can you guys please help me with this.

Last edited by lecramyajiv; 03-18-2022 at 01:57 AM.
 
Old 03-17-2022, 02:21 PM   #2
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 907

Rep: Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697Reputation: 697
I also had a problem with lensfun and opencv (and I found a patch for glslang). My solution: Don't enable those options. Here is my slackrepo hint file for ffmpeg (My slackrepo points to a local tree with my additions on top of the 15.0 branch of SBo):

Code:
ADDREQUIRES=" \
	nv-codec-headers \
	x264             \
	celt             \
	libdc1394        \
	libavc1394       \
	gsm              \
	rtmpdump         \
	xvidcore         \
	libass           \
	libiec61883      \
	libilbc          \
	libmodplug       \
	twolame          \
	ladspa_sdk       \
	flite            \
	x265             \
	zvbi             \
	libgme           \
	snappy           \
	libbs2b          \
	rubberband       \
	jack             \
	aom              \
	lv2              \
        lilv             \
	dav1d            \
	codec2           \
	soxr             \
	srt              \
	zimg             \
	chromaprint      \
	opencore-amr     \
	libfdk-aac"
OPTIONS=" \
	CUDA=yes \
	CUDAINCDIR=/usr/local/cuda/include \
	CUDALDDIR=/usr/local/cuda/lib64 \
	LIBNPP=yes \
	X264=yes \
	CELT=yes \
	DC1394=yes \
	GSM=yes \
	RTMP=yes \
	XVID=yes \
	ASS=yes \
	IEC61883=yes \
	ILBC=yes \
	MODPLUG=yes \
	TWOLAME=yes \
	LADSPA=yes \
	FLITE=yes \
	X265=yes \
	ZVBI=yes \
	OPENCV=no \
	GME=yes \
	SNAPPY=yes \
	BS2B=yes \
	RUBBERBAND=yes \
	JACK=yes \
	AOM=yes \
	LV2=yes \
	DAV1D=yes \
	CODEC2=yes \
	SOXR=yes \
	SRT=yes \
	ZIMG=yes \
	CHROMAPRINT=yes \
	OPENCORE=yes \
	FDK_AAC=yes \
	VULKAN=yes \
	GLSLANG=yes \
	LENSFUN=no \
	AAC=yes"
I just used ffmpeg-4.4.1 (with 2 additional patches - 1 for glslang). I did not try 5.0.

Here is the diff for my ffmpeg.SlackBuild:

Code:
diff --git a/ffmpeg.SlackBuild b/ffmpeg.SlackBuild
old mode 100644
new mode 100755
index 6d4c4eb..7d7d891
--- a/ffmpeg.SlackBuild
+++ b/ffmpeg.SlackBuild
@@ -167,6 +167,12 @@ libdrm=""     ; [ "${LIBDRM:-yes}" != "no" ]      && libdrm="--enable-libdrm"
 # No default patent encumbered features:
 aac=""        ; [ "${AAC:-no}" = "no" ]           && aac="--disable-encoder=aac"
 
+# Options added by Erich
+cuda=""       ; [ "${CUDA:-no}" != "no" ]         && cuda="--enable-cuda-nvcc"
+libnpp=""     ; [ "${LIBNPP:-no}" != "no" ]       && libnpp="--enable-libnpp"
+cuda_cflags=""; [ "${CUDAINCDIR:-no}" != "no" ]   && cuda_cflags="--extra-cflags=-I${CUDAINCDIR}"
+cuda_ldflags="";[ "${CUDALDDIR:-no}" != "no" ]    && cuda_ldflags="--extra-ldflags=-L${CUDALDDIR}"
+
 rm -rf $PKG
 mkdir -p $TMP $PKG
 cd $TMP
@@ -181,6 +187,12 @@ find -L . \
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
 
+# Patch for newer CUDA toolkits
+patch -p1 < $CWD/detect-nvcc-without-sm_30-support.patch
+
+# Patch for glslang link flags
+patch -p1 < $CWD/glslang-link-flags.patch
+
 # Fix linking with flite:
 sed -i "s| -lflite\"| -lflite -lm -lasound\"|" \
   ./configure
@@ -203,6 +215,9 @@ CXXFLAGS="$SLKCFLAGS" \
   $non_free \
   $aac \
   $chromaprint \
+  $cuda \
+  $cuda_cflags \
+  $cuda_ldflags \
   $decklink \
   $fdk \
   $fontconfig \
@@ -224,6 +239,7 @@ CXXFLAGS="$SLKCFLAGS" \
   $libiec61883 \
   $libilbc \
   $libmodplug \
+  $libnpp \
   $libopenal \
   $libopencv \
   $libopus \
And my 2 patches:
Code:
$ cat slackbuilds/multimedia/ffmpeg/detect-nvcc-without-sm_30-support.patch 
--- a/configure
+++ b/configure
@@ -4388,8 +4388,16 @@ else
     NVCC_C=""
 fi
 
+set_default nvcc
+
+if enabled cuda_nvcc; then
+    if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
+        nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
+    fi
+fi
+
 set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
-    target_exec x86asmexe nvcc
+    target_exec x86asmexe
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
Code:
$ cat slackbuilds/multimedia/ffmpeg/glslang-link-flags.patch 
diff --git a/configure b/configure
index 013780d..1de3802 100755
--- a/configure
+++ b/configure
@@ -6375,7 +6375,7 @@ enabled fontconfig        && enable libfontconfig
 enabled libfontconfig     && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
 enabled libfreetype       && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
 enabled libfribidi        && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
-enabled libglslang        && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h "glslang::TIntermediate*" -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++
+enabled libglslang        && require_cpp libglslang glslang/SPIRV/GlslangToSpv.h "glslang::TIntermediate*" -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++
 enabled libgme            && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
                                require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
 enabled libgsm            && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
 
1 members found this post helpful.
Old 03-17-2022, 09:35 PM   #3
notzed
Member
 
Registered: Dec 2020
Location: South Australia
Distribution: slackware64-current
Posts: 95

Rep: Reputation: Disabled
lensfun just looks like a version mismatch going by that WONTFIX bug report. But the ffmpeg source doesn't seem to specify which is the correct one, so you might have to experiment a bit.

Looks like opencv is also a version mismatch and the one in slackware is just too new for ffmpeg. It's looking for the pkg-config of 'opencv' but it's 'opencv4' in slackware. Patching the configure script doesn't work because opencv4 seems to require a c++ compiler now. Perhaps you could try an ffmpeg snapshot/git but who knows, ffmpeg developers work to their own schedule and sometimes the filters aren't a priority.
 
Old 03-18-2022, 01:56 AM   #4
lecramyajiv
Member
 
Registered: Jul 2015
Distribution: Slackware64
Posts: 30

Original Poster
Rep: Reputation: Disabled
solved

Thanks for the reply guys, today I was checking the Debian package build and apparently opencv can't be enabled and conflicts with the opencv4 package. same with lensfun but I swear when i was using Debian it had been enabled. Glslang can be enabled with newer versions so no problem there. The solution would be do not enable these options for ffmpeg 4.4.1.
I'm attaching the ffmpeg debian.readme and TODO file from ffmpeg_5.0-3.debian.tar.xz file were they talk about it.
Attached Files
File Type: txt README.Debian.txt (969 Bytes, 23 views)
File Type: txt TODO.txt (2.0 KB, 18 views)

Last edited by lecramyajiv; 03-18-2022 at 02:29 AM. Reason: added extra info
 
  


Reply

Tags
ffmpeg4, opencv



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] lensfun on ARMv7 aihaike Slackware - ARM 2 09-14-2016 03:01 AM
How to update the LensFun database in Darktable? cryan Linux - Software 1 03-12-2015 02:31 PM
lensfun-0.2.5 causing segfaults in digikam and ufraw Franklin Slackware 3 01-02-2011 06:39 PM
Install FFMPEG and FFMPEG-PHP on fedora10 & 12 cks Linux - Server 2 09-17-2010 01:55 PM
ffmpeg: symbol lookup error: ffmpeg: undefined symbol: avformat_alloc_context YeeHaa4LINUX Linux - Software 2 10-16-2009 11:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration