[FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

Rodger Combs rodger.combs at gmail.com
Fri Oct 2 22:35:04 CEST 2015


---
 Changelog                |  1 +
 configure                |  4 ++++
 doc/muxers.texi          | 35 +++++++++++++++++++++++++++++++++++
 libavformat/Makefile     |  1 +
 libavformat/allformats.c |  1 +
 libavformat/version.h    |  2 +-
 6 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 515d649..1b7e44d 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,7 @@ version <next>:
 - agate filter
 - chromakey filter
 - maskedmerge filter
+- chromaprint fingerprinting muxer
 
 
 version 2.8:
diff --git a/configure b/configure
index 361c024..b9731c0 100755
--- a/configure
+++ b/configure
@@ -197,6 +197,7 @@ Individual component options:
 External library support:
   --enable-avisynth        enable reading of AviSynth script files [no]
   --disable-bzlib          disable bzlib [autodetect]
+  --enable-chromaprint     enable audio fingerprinting with chromaprint [no]
   --enable-fontconfig      enable fontconfig, useful for drawtext filter [no]
   --enable-frei0r          enable frei0r video filtering [no]
   --enable-gnutls          enable gnutls, needed for https support
@@ -1367,6 +1368,7 @@ EXAMPLE_LIST="
 EXTERNAL_LIBRARY_LIST="
     avisynth
     bzlib
+    chromaprint
     crystalhd
     decklink
     frei0r
@@ -2505,6 +2507,7 @@ vc1_parser_select="mpegvideo startcode vc1_decoder"
 mjpeg2jpeg_bsf_select="jpegtables"
 
 # external libraries
+chromaprint_muxer_deps="chromaprint"
 libaacplus_encoder_deps="libaacplus"
 libcelt_decoder_deps="libcelt"
 libdcadec_decoder_deps="libdcadec"
@@ -5242,6 +5245,7 @@ enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActi
 enabled avisynth          && { { check_lib2 "windows.h" LoadLibrary; } ||
                                { check_lib2 "dlfcn.h" dlopen -ldl; } ||
                                die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
+enabled chromaprint       && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
 enabled decklink          && { check_header DeckLinkAPI.h || die "ERROR: DeckLinkAPI.h header not found"; }
 enabled frei0r            && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
 enabled gnutls            && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 86ca4ad..91d131f 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -37,6 +37,41 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
 
 @end table
 
+ at anchor{chromaprint}
+ at section chromaprint
+
+Chromaprint fingerprinter
+
+This muxer feeds audio data to the Chromaprint library, which generates
+a fingerprint for the provided audio data. It takes a single signed
+native-endian 16-bit raw audio stream.
+
+ at subsection Options
+
+ at table @option
+ at item silence_threshold
+Threshold for detecting silence, ranges from 0 to 32767. -1 for default
+(required for use with the AcoustID service).
+
+ at item algorithm
+Algorithm index to fingerprint with.
+
+ at item fp_format
+Format to output the fingerprint as. Accepts the following options:
+ at table @samp
+ at item raw
+Binary raw fingerprint
+
+ at item compressed
+Binary compressed fingerprint
+
+ at item base64
+Base64 compressed fingerprint
+
+ at end table
+
+ at end table
+
 @anchor{crc}
 @section crc
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..c9bf20f 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -487,6 +487,7 @@ OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)        += yuv4mpegenc.o
 OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER)      += yuv4mpegdec.o
 
 # external libraries
+OBJS-$(CONFIG_CHROMAPRINT_MUXER)         += chromaprint.o
 OBJS-$(CONFIG_LIBGME_DEMUXER)            += libgme.o
 OBJS-$(CONFIG_LIBMODPLUG_DEMUXER)        += libmodplug.o
 OBJS-$(CONFIG_LIBNUT_DEMUXER)            += libnut.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0a24ac7..0ccde9d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -391,6 +391,7 @@ void av_register_all(void)
     REGISTER_PROTOCOL(UNIX,             unix);
 
     /* external libraries */
+    REGISTER_MUXER   (CHROMAPRINT,      chromaprint);
     REGISTER_DEMUXER (LIBGME,           libgme);
     REGISTER_DEMUXER (LIBMODPLUG,       libmodplug);
     REGISTER_MUXDEMUX(LIBNUT,           libnut);
diff --git a/libavformat/version.h b/libavformat/version.h
index 743617e..f7a2e09 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR   2
+#define LIBAVFORMAT_VERSION_MINOR   3
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
2.6.0



More information about the ffmpeg-devel mailing list