Below we document the steps to building a minimal GIFT-Grab such that the SciPy example can be executed. The steps are for Debian 9, but are mostly identical to Ubuntu. Wherever applicable we highlight the differences. In case you experience problems, please check the known issues and limitations as well as the dependency installation guidelines.
- pkg-config:
apt install pkg-config
- GCC:
apt install build-essential
- Python libraries:
apt install python-dev
(Please note that GIFT-Grab currently supports only Python 2) - Git:
apt install git
- CMake:
apt install cmake
- FFmpeg (for Ubuntu, please see these instructions instead):
apt install libavfilter-dev
apt install libavutil-dev
apt install libswscale-dev
apt install libavcodec-dev
apt install libavformat-dev
- NumPy:
apt install python-numpy
- SciPy:
apt install python-scipy
- Boost:
wget https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.bz2
tar xvfj boost_1_63_0.tar.bz2
cd boost_1_63_0
./bootstrap.sh --with-libraries=python
. To install Boost in a non-standard path (for instance if you don't want to break your existing Boost installation):- Append
--prefix=/your/custom/boost/install/path
to the./bootstrap.sh
command above, - Set
BOOST_ROOT
accordingly. For the hypothetical path above this can be achieved viaexport BOOST_ROOT=/your/custom/boost/install/path/include
(note theinclude
at the end of the path).
- Append
./b2
./b2 install
- Clone the GIFT-Grab repository:
git clone https://github.com/gift-surg/GIFT-Grab.git
- Create a build folder and change into it:
mkdir gift-grab-build; cd gift-grab-build
- Configure GIFT-Grab for reading video files and encoding HEVC files:
cmake -D BUILD_PYTHON=ON -D USE_FILES=ON -D USE_HEVC=ON -D USE_NUMPY=ON -D ENABLE_GPL=ON -D USE_X265=ON ../GIFT-Grab/src
- This configuration uses x265 as x265 is supported by FFmpeg on Debian 9 by default.
- However GIFT-Grab supports other libraries for HEVC as well.
- Compile GIFT-Grab:
make -j
(This will create apygiftgrab.so
in the build folder).
- Download a sample HEVC video file (for instance from this website) and save it as
/tmp/myinput.mp4
. - Save the SciPy example as
ggscipyex.py
within the build folder. - Execute the SciPy example within the build folder:
python2 ggscipyex.py
- See the produced output file
/tmp/myoutput.mp4
.- It should contain a Gaussian-smoothed version of the downloaded HEVC video.
- Note that this output file should always contain the first few frames from the downloaded file; however it may not contain all frames to the end.
- This is because encoding is a computationally intensive task and to be able to encode all frames you might need GPU-accelerated encoding.
- GIFT-Grab can be configured to use NVENC for GPU-accelerated encoding.