ffmpeg-build-script icon indicating copy to clipboard operation
ffmpeg-build-script copied to clipboard

Zscale filter needs zimg lib.

Open stefcarlens opened this issue 4 years ago • 4 comments
trafficstars

It would be great if libzimg is added to this script. This is needed for getting the new ZScale to work.

Here is the source https://github.com/sekrit-twc/zimg but I have little knowledge how to add this.

stefcarlens avatar May 24 '21 14:05 stefcarlens

Would add as PR but has some things not sure how they want to address. First libtools must be installed (aka sudo apt install libtools) and then after this was run I had to run sudo ldconfig -v to regen library cache or else it couldn't find libzimg.so.2.

if build "zimg"; then
  download "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.3.tar.gz"
  execute ./autogen.sh
  execute ./configure --prefix="${WORKSPACE}"
  execute make -j $MJOBS
  execute make install
  build_done "zimg"
fi
CONFIGURE_OPTIONS+=("--enable-libzimg")

cdgriffith avatar Sep 06 '21 19:09 cdgriffith

Would add as PR but has some things not sure how they want to address. First libtools must be installed (aka sudo apt install libtools) and then after this was run I had to run sudo ldconfig -v to regen library cache or else it couldn't find libzimg.so.2.

if build "zimg"; then
  download "https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.3.tar.gz"
  execute ./autogen.sh
  execute ./configure --prefix="${WORKSPACE}"
  execute make -j $MJOBS
  execute make install
  build_done "zimg"
fi
CONFIGURE_OPTIONS+=("--enable-libzimg")

I tested a static build of FFMPEG with libzimg and dav1d only. At first, I was also getting the above "library not found" error while running the statically built ffmpeg.

It has two fixes.

  1. Re-gen library cache where system-installed libtool is present
  2. Build latest GNU libtool statically + install it in workspace + use libtoolize inside zimg repo folder to fix some files, and then autogen + build libzimg fully static.

I added --enable-static --disable-shared flags with the ./configure part while building.

Any of the upper two fixes worked for me in Ubuntu and showed no missing library error.

Use Case 2: Where I built libtool statically and didn't refresh library cache

Previous Use Cases: With system-installed libtool, even if I build static or shared or static+shared libzimg, after building ffmpeg, while running the program, it showed library missing error. But re-generating library cache just before compiling ffmpeg (tried only for static ffmpeg build) with static libzimg works fine.

rokibhasansagar avatar Sep 13 '21 05:09 rokibhasansagar

@rokibhasansagar https://github.com/markus-perl/ffmpeg-build-script/pull/106 was just merged and adds zimg support. Had to do what your second solution was, using libtoolize as well.

cdgriffith avatar Sep 13 '21 13:09 cdgriffith

@rokibhasansagar #106 was just merged and adds zimg support. Had to do what your second solution was, using libtoolize as well.

Actually, that was originally your solution. I was following up your forked project to fix this in fully static build.

rokibhasansagar avatar Sep 13 '21 15:09 rokibhasansagar