Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 3.48 KB

minimal.md

File metadata and controls

66 lines (53 loc) · 3.48 KB

Minimal GIFT-Grab version

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.

Installing needed tools and libraries

  1. pkg-config: apt install pkg-config
  2. GCC: apt install build-essential
  3. Python libraries: apt install python-dev (Please note that GIFT-Grab currently supports only Python 2)
  4. Git: apt install git
  5. CMake: apt install cmake
  6. 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
  7. NumPy: apt install python-numpy
  8. SciPy: apt install python-scipy
  9. 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):
      1. Append --prefix=/your/custom/boost/install/path to the ./bootstrap.sh command above,
      2. Set BOOST_ROOT accordingly. For the hypothetical path above this can be achieved via export BOOST_ROOT=/your/custom/boost/install/path/include (note the include at the end of the path).
    • ./b2
    • ./b2 install

Obtaining and building GIFT-Grab

  1. Clone the GIFT-Grab repository: git clone https://github.com/gift-surg/GIFT-Grab.git
  2. Create a build folder and change into it: mkdir gift-grab-build; cd gift-grab-build
  3. 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
  4. Compile GIFT-Grab: make -j (This will create a pygiftgrab.so in the build folder).

Running the SciPy example

  1. Download a sample HEVC video file (for instance from this website) and save it as /tmp/myinput.mp4.
  2. Save the SciPy example as ggscipyex.py within the build folder.
  3. Execute the SciPy example within the build folder: python2 ggscipyex.py
  4. 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.