Compile "shotdetect" 1.0.86 with ffmpeg version 0.6-0.7

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

Compile "shotdetect" 1.0.86 with ffmpeg version 0.6-0.7

Post by ^rooker »

The promising scene-detection tool "shotdetect", expects an oder version of ffmpeg, which causes problems, because ffmpeg has changed their library layout (and therefore also the folder structure).

A friend of mine added a few "search for the libs" entries in "configure.in", as well as removed the library inclusion strings of "/lib/include/ffmpeg/" (obsolete).

Here's a link to the unified patch file:
shotdetect-1.0.86-1.0.87.patch.bz2

Here's a quick summary of how to get it working:
1) Download the tar.gz of shotdetect v1.0.86
2) Unzip it:

Code: Select all

tar -xzf latest.tar.gz
3) Apply the patch:

Code: Select all

patch -p 0 < shotdetect-1.0.86-1.0.87.patch
4) Go to the shotdetect folder:

Code: Select all

cd shotdetect-1.0.86
5) configure and make:

Code: Select all

./configure --prefix=/usr/local
make
6) Install it as package, using "checkinstall":

Code: Select all

sudo checkinstall --pkgname=shotdetect -pkgversion="`date +%Y%m%d%H%M`-1.0.87" --backup=no --default 
Enjoy!
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: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Compile "shotdetect" 1.0.86 with ffmpeg version 0.6-0.7

Post by ^rooker »

[PROBLEM]

Code: Select all

./configure: line 3865: AM_OPTIONS_WXCONFIG: command not found
./configure: line 3880: syntax error near unexpected token `2.6.0,'
./configure: line 3880: `AM_PATH_WXCONFIG(2.6.0, wxWin=1)'
...or the same error message with a variable version number:

Code: Select all

./configure: line 3879: AM_OPTIONS_WXCONFIG: command not found
./configure: line 3881: syntax error near unexpected token `$reqwx,'
./configure: line 3881: `AM_PATH_WXCONFIG($reqwx, wxWin=1)'
[SOLUTION]
There are multiple reasons for this error:

1) Usually, 2 packages are missing: "libwxgtk2.x-dev" and "wx-common". Install them. :)

2) Although "/usr/bin/wx-config" and "/usr/share/aclocal/wxwin.m4" exist, configure still complains. I'm still debugging that one...

3) But in the SVN version of shotdetect, the configure.in script had an error, which cause the wxconfig-automake part to fail and not find the m4 files for wxwidgets (e.g. /usr/share/aclocal/wxwin.m4).
I've now used the codeblock from the wxWidgets/Autoconf WIKI page:

Code: Select all

AM_OPTIONS_WXCONFIG
reqwx=2.4.0
AM_PATH_WXCONFIG($reqwx, wxWin=1)
if test "$wxWin" != 1; then
	AC_MSG_ERROR([
		wxWidgets must be installed on your system.
 
		Please check that wx-config is in path, the directory
		where wxWidgets libraries are installed (returned by
		'wx-config --libs' or 'wx-config --static --libs' command)
		is in LD_LIBRARY_PATH or equivalent variable and
		wxWidgets version is $reqwx or above.
		])
fi
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: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Graphs produced by shotdetect won't open in web-browser

Post by ^rooker »

[PROBLEM]
Some graphs produced by shotdetect can't be opened in web-browsers, although they display normal in graphic applications.
For example, FireFox complains with the following error:

Code: Select all

Die Grafik "http://xxx" kann nicht angezeigt werden, weil sie Fehler enthält.
(english: "The image 'http://xxx' can't be opened, because it contains errors")

This only happens because the graphs are too wide.
Each x-pixel in the shotdetect graphs represents 1 frame, so a 1-minute file at 25fps would be: 60 * 25 = 1500

So those graphs get pretty wide pretty fast.


[SOLUTION]
I needed to open them in a web-interface, so to get the whole graph in a browser, I'm simply using "imagemagick" to tile the graph into 20-minute segments:
20 * 60 * 25 = 30000px

Thanks to an ImageMagick example about crop/tile functionality, I quickly had the following solution at hand:

Code: Select all

convert wide_graph.png -crop 30000 graph_tiles_%02d.png
(I've omitted a height value, so the target height is automatically selected with aspect ratio being preserved. For other cases read more about ImageMagick's geometry)
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: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Re: Compile "shotdetect" 1.0.86 with recent version of ffmpeg

Post by ^rooker »

[PROBLEM]
While trying to compile shotdetect on Debian Squeeze, I ran into the following error, when running "make":
cd . && aclocal-1.10
/bin/bash: aclocal-1.10: command not found
make: *** [aclocal.m4] Error 127
[SOLUTION]
I was lacking the "automake1.10" package!
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