Perhaps the best way to get a copy of FFmpeg and the zscale filter is to use, but slightly modify, the excellent FFmpeg trac compilation guide. This guide will not interfere with system libraries.
This can be accomplished in only two easy steps:
1. Install zimg:
When installing the long list of dependencies in the guide add the following to also install zimage
:
mkdir -p ~/ffmpeg_sources && \
cd ~/ffmpeg_sources && \
wget https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.2.tar.gz && \
tar xvf release-3.0.2.tar.gz && \
cd zimg-release-3.0.2 && \
./autogen.sh && \
./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \
make && \
make install
This installs a local copy of zimg
that FFmpeg will pick up when it is compiled.
2. Compile FFmpeg:
Follow the full FFmpeg trac guide and when you reach the section where FFmpeg is compiled simply add the following to the ./configure
string:
--enable-libzimg
And this will be enough to enable the zscale filter.
3. Testing, testing...
FFmpeg itself can be tested for presence of the zscale filter:
andrew@ithaca:~$ ffmpeg -filters 2> /dev/null |grep zscale
..C zscale V->V Apply resizing, colorspace and bit depth conversion.
andrew@ithaca:~$
I tested ffmkv
itself with a big upscale in size:
andrew@ithaca:~$ ffmkv --preset 'Up to 4K, original audio, 4GB per hour VBR, HDR' input.mkv output.mkv
Audio is Stream Copy VBR, filesize will be greater than estimated.
Processing pass 1 of VBR video, remaining time is remaining time for pass 1 only.
Process will sit on 100% while ffmpeg closes out functions.
ffmpeg conversion of input.mkv started on 08/30/21 7:53:05 PM
input.mkv has 1248 frames, now converting
ffmpeg: 1253 of 1248 frames at 24 fps, progress: 100% and ETA: 0h 0m 0s
ffmpeg stopped on 08/30/21 7:54:06 PM
Processing pass 2 of VBR video, remaining time is total remaining time.
Process will sit on 100% while ffmpeg closes out functions.
ffmpeg conversion of input.mkv started on 08/30/21 7:54:06 PM
input.mkv has 1248 frames, now converting
ffmpeg: 1253 of 1248 frames at 23 fps, progress: 100% and ETA: 0h 0m 0s
ffmpeg stopped on 08/30/21 7:55:06 PM
andrew@ithaca:~$
And all is well :)