Compiling Shotdetect from github on Debian 7

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Compiling Shotdetect from github on Debian 7

Post by ^rooker »

Recent threads about compiling shotdetect were either based on the old v1.0.86 tarball or Giulio Paci's Debian package source.

Johan's original shotdetect repo was forked by Peter B. to include some fixes and new features.
Maybe they'll get merged back to the main repository, but until now, I'll show you how to compile his version:

1) Clone git repository:
On Shotdetect's GitHub page you find the URL for cloning on the right hand side.
Something like this: https://github.com/johmathe/Shotdetect.git
Copy it to your clipboard.
Now, clone it into some folder in your home directory:

Code: Select all

$ mkdir -p ~/install/shotdetect
$ git clone https://github.com/johmathe/Shotdetect.git ~/install/shotdetect/shotdetect-git
2) Install build-dependencies:
I currently don't have the exact list of which packages are minimum requirement, but I've found a list of required packages for building v1.0.86 on Debian 6.

Install the following packages:

Code: Select all

$ apt-get install build-essential checkinstall libxml2-dev libxslt1-dev libavformat-dev libswscale-dev libgd2-noxpm libgd2-noxpm-dev
These are additional requirements for the new cmake version of shotdetect:

Code: Select all

$ apt-get install cmake clang libavdevice-dev
3) Build and compile the sourcecode:
Change to the shotdetect git directory.
This builds and compiles the commandline version:

Code: Select all

$ ./compile.sh cmd
You should now have the shotdetect binary in "build/shotdetect-cmd".

4) Install it as a package:
Currently, the Debian package source for shotdetect is not compatible for using it with the current git head version.

Therefore I'll use "checkinstall", which does a pretty good job :)

You may edit the description for the package, by modifying the file called "description-pak", which contains this by default:
'Shotdetect' detects scene cuts within a movie.

The result produced is a simple XML file containing informations about the analyzed video/audio material, such as:
- Quantity of movement
- RGB color values
- HSV color values
Now run checkinstall on the "make install" command:

Code: Select all

$ cd build && sudo checkinstall -D --install --pkgname=shotdetect --pkgversion=1:2.0.0-git --provides=shotdetect  --pkglicense=GPL --nodoc
If everything went fine, shotdetect v2.0.0 should be installed in "/usr/local" now.

NOTE: You might have to update your scripts using shotdetect, because the commandline binary was renamed to "shotdetect-cmd", and the default "shotdetect" points to the GUI version.
Last edited by ^rooker on Thu Feb 12, 2015 5:32 pm, edited 2 times in total.
Reason: Updated package dependencies and compilation instructions
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

CMake Error: "CMAKE_CXX_COMPILER-NOTFOUND"

Post by ^rooker »

If you get the following error when trying to compile shotdetect, you are probably missing the "build-essential" package:
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply