Commit fdf11906 authored by Diego Biurrun's avatar Diego Biurrun
Browse files

Remove deprecated vhook subsystem.

Originally committed as revision 17769 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent f989d397
......@@ -18,15 +18,6 @@ Applications
ffmpeg:
ffmpeg.c Michael Niedermayer
Video Hooks:
vhook
vhook/watermark.c Marcus Engene
vhook/ppm.c
vhook/drawtext.c
vhook/fish.c
vhook/null.c
vhook/imlib2.c
ffplay:
ffplay.c Michael Niedermayer
......
......@@ -32,10 +32,8 @@ FF_LDFLAGS := $(FFLDFLAGS)
FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS)
ALL_TARGETS-$(CONFIG_VHOOK) += videohook
ALL_TARGETS-$(BUILD_DOC) += documentation
INSTALL_TARGETS-$(CONFIG_VHOOK) += install-vhook
ifneq ($(PROGS),)
INSTALL_TARGETS-yes += install-progs install-data
INSTALL_TARGETS-$(BUILD_DOC) += install-man
......@@ -81,41 +79,8 @@ cmdutils.o cmdutils.d: version.h
alltools: $(addsuffix $(EXESUF),$(addprefix tools/, cws2fws pktdumper qt-faststart trasher))
VHOOKCFLAGS += $(filter-out -mdynamic-no-pic,$(CFLAGS))
BASEHOOKS = fish null watermark
ALLHOOKS = $(BASEHOOKS) drawtext imlib2 ppm
ALLHOOKS_SRCS = $(addprefix vhook/, $(addsuffix .c, $(ALLHOOKS)))
HOOKS-$(HAVE_FORK) += ppm
HOOKS-$(HAVE_IMLIB2) += imlib2
HOOKS-$(HAVE_FREETYPE2) += drawtext
HOOKS = $(addprefix vhook/, $(addsuffix $(SLIBSUF), $(BASEHOOKS) $(HOOKS-yes)))
VHOOKCFLAGS-$(HAVE_IMLIB2) += `imlib2-config --cflags`
LIBS_imlib2$(SLIBSUF) = `imlib2-config --libs`
VHOOKCFLAGS-$(HAVE_FREETYPE2) += `freetype-config --cflags`
LIBS_drawtext$(SLIBSUF) = `freetype-config --libs`
VHOOKCFLAGS += $(VHOOKCFLAGS-yes)
vhook/%.o vhook/%.d: CFLAGS:=$(VHOOKCFLAGS)
# vhooks compile fine without libav*, but need them nonetheless.
videohook: $(FF_DEP_LIBS) $(HOOKS)
$(eval VHOOKSHFLAGS=$(VHOOKSHFLAGS))
vhook/%$(SLIBSUF): vhook/%.o
$(CC) $(LDFLAGS) -o $@ $(VHOOKSHFLAGS) $< $(VHOOKLIBS) $(LIBS_$(@F))
VHOOK_DEPS = $(HOOKS:$(SLIBSUF)=.d)
depend dep: $(VHOOK_DEPS)
documentation: $(addprefix doc/, ffmpeg-doc.html faq.html ffserver-doc.html \
ffplay-doc.html general.html hooks.html \
$(ALLMANPAGES))
ffplay-doc.html general.html $(ALLMANPAGES))
doc/%.html: doc/%.texi
texi2html -monolithic -number $<
......@@ -141,11 +106,7 @@ install-man: $(MANPAGES)
install -d "$(MANDIR)/man1"
install -m 644 $(MANPAGES) "$(MANDIR)/man1"
install-vhook: videohook
install -d "$(SHLIBDIR)/vhook"
install -m 755 $(HOOKS) "$(SHLIBDIR)/vhook"
uninstall: uninstall-progs uninstall-data uninstall-man uninstall-vhook
uninstall: uninstall-progs uninstall-data uninstall-man
uninstall-progs:
rm -f $(addprefix "$(BINDIR)/", $(ALLPROGS))
......@@ -156,10 +117,6 @@ uninstall-data:
uninstall-man:
rm -f $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
uninstall-vhook:
rm -f $(addprefix "$(SHLIBDIR)/",$(ALLHOOKS_SRCS:.c=$(SLIBSUF)))
-rmdir "$(SHLIBDIR)/vhook/"
testclean:
rm -rf tests/vsynth1 tests/vsynth2 tests/data tests/asynth1.sw tests/*~
......@@ -168,10 +125,9 @@ clean:: testclean
rm -f doc/*.html doc/*.pod doc/*.1
rm -f $(addprefix tests/,$(addsuffix $(EXESUF),audiogen videogen rotozoom seek_test tiny_psnr))
rm -f $(addprefix tools/,$(addsuffix $(EXESUF),cws2fws pktdumper qt-faststart trasher))
rm -f vhook/*.o vhook/*~ vhook/*.so vhook/*.dylib vhook/*.dll
distclean::
rm -f version.h config.* vhook/*.d
rm -f version.h config.*
# regression tests
......@@ -355,6 +311,4 @@ tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS)
$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS)
.PHONY: lib videohook documentation *test regtest-* swscale-error zlib-error alltools check
-include $(VHOOK_DEPS)
.PHONY: lib documentation *test regtest-* swscale-error zlib-error alltools check
......@@ -82,9 +82,8 @@ show_help(){
echo " --disable-ffserver disable ffserver build"
echo " --enable-postproc enable GPLed postprocessing support [no]"
echo " --enable-swscale enable GPLed software scaler support [no]"
echo " --enable-avfilter video filter support (replaces vhook) [no]"
echo " --enable-avfilter video filter support [no]"
echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
echo " --disable-vhook disable video hooking support"
echo " --enable-beosthreads use BeOS threads [no]"
echo " --enable-os2threads use OS/2 threads [no]"
echo " --enable-pthreads use pthreads [no]"
......@@ -799,7 +798,6 @@ CONFIG_LIST="
static
swscale
vdpau
vhook
x11grab
zlib
"
......@@ -873,11 +871,9 @@ HAVE_LIST="
fast_cmov
fast_unaligned
fork
freetype2
gethrtime
GetProcessTimes
getrusage
imlib2
inet_aton
inline_asm
libdc1394_1
......@@ -1133,7 +1129,6 @@ movie_filter_deps="avfilter_lavf"
ffplay_deps="sdl"
ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
ffserver_extralibs='$ldl'
vhook_extralibs='$ldl'
# default parameters
......@@ -1180,12 +1175,10 @@ enable optimizations
enable protocols
enable static
enable stripping
vhook="default"
# build settings
add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
SHFLAGS='-shared -Wl,-soname,$$(@F)'
VHOOKSHFLAGS='$(SHFLAGS)'
FFSERVERLDFLAGS=-Wl,-E
LIBPREF="lib"
LIBSUF=".a"
......@@ -1560,7 +1553,6 @@ case $target_os in
darwin)
disable need_memalign
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$$(@F)'
strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
SLIBSUF=".dylib"
......@@ -1578,12 +1570,6 @@ case $target_os in
LIBTARGET=x64
fi
shlibdir_default="$bindir_default"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
if enabled swscale; then
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
disable ffserver
SLIBPREF=""
SLIBSUF=".dll"
......@@ -1607,12 +1593,6 @@ case $target_os in
cygwin*)
target_os=cygwin
shlibdir_default="$bindir_default"
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
if enabled swscale; then
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
SLIBPREF="cyg"
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
......@@ -1622,7 +1602,7 @@ case $target_os in
enable dos_paths
;;
*-dos|freedos|opendos)
disable ffplay ffserver vhook
disable ffplay ffserver
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket"
objformat="coff"
......@@ -1656,12 +1636,8 @@ case $target_os in
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
disable vhook
enable dos_paths
;;
interix)
disable vhook
;;
*)
die "Unknown OS '$target_os'."
......@@ -2040,24 +2016,6 @@ void foo(char * $restrict_keyword p);
EOF
done
test "$vhook" = "default" && vhook="$dlopen"
if test "$target_os" = cygwin -o "$target_os" = mingw32 && enabled_all static vhook ; then
disable vhook
echo
echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
echo "Patches welcome."
echo
fi
if enabled vhook; then
check_ldflags -rdynamic
check_ldflags -export-dynamic
fi
check_foo_config imlib2 imlib2 Imlib2.h imlib_load_font
check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType
##########################################
# SDL check
......@@ -2225,8 +2183,6 @@ if enabled gprof; then
add_ldflags -p
fi
VHOOKCFLAGS="-fPIC"
# Find out if the .align argument is a power of two or not.
check_asm asmalign_pot '".align 3"'
......@@ -2312,11 +2268,6 @@ echo "postprocessing support ${postproc-no}"
echo "software scaler enabled ${swscale-no}"
echo "new filter support ${avfilter-no}"
echo "filters using lavformat ${avfilter_lavf-no}"
echo "video hooking ${vhook-no}"
if enabled vhook; then
echo "Imlib2 support ${imlib2-no}"
echo "FreeType support ${freetype2-no}"
fi
echo "network support ${network-no}"
if enabled network; then
echo "IPv6 support ${ipv6-no}"
......@@ -2395,13 +2346,10 @@ enabled stripping &&
echo "STRIP=echo ignoring strip" >> config.mak
echo "OPTFLAGS=$CFLAGS" >> config.mak
echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak
echo "LDFLAGS=$LDFLAGS" >> config.mak
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
echo "SHFLAGS=$SHFLAGS" >> config.mak
echo "YASMFLAGS=$YASMFLAGS" >> config.mak
echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
echo "BUILD_STATIC=$static" >> config.mak
echo "BUILDSUF=$build_suffix" >> config.mak
......@@ -2529,7 +2477,6 @@ if enabled source_path_used; then
libswscale \
tests \
tools \
vhook \
"
FILES="\
Makefile \
......
......@@ -660,9 +660,6 @@ Calculate PSNR of compressed frames.
Dump video coding statistics to @file{vstats_HHMMSS.log}.
@item -vstats_file @var{file}
Dump video coding statistics to @var{file}.
@item -vhook @var{module}
Insert video processing @var{module}. @var{module} contains the module
name and its parameters separated by spaces.
@item -top @var{n}
top=1/bottom=0/auto=-1 field first
@item -dc @var{precision}
......
......@@ -691,10 +691,6 @@ Notes:
@itemize
@item In order to compile vhooks, you must have a POSIX-compliant libdl in
your MinGW system. Get dlfcn-win32 from
@url{http://code.google.com/p/dlfcn-win32}.
@item In order to compile FFplay, you must have the MinGW development library
of SDL. Get it from @url{http://www.libsdl.org}.
Edit the @file{bin/sdl-config} script so that it points to the correct prefix
......
\input texinfo @c -*- texinfo -*-
@settitle Video Hook Documentation
@titlepage
@sp 7
@center @titlefont{Video Hook Documentation}
@sp 3
@end titlepage
@chapter Introduction
@var{Please be aware that vhook is deprecated, and hence its development is
frozen (bug fixes are still accepted).
The substitute will be 'libavfilter', the result of our 'Video Filter API'
Google Summer of Code project. You may monitor its progress by subscribing to
the ffmpeg-soc mailing list at
@url{http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc}.}
The video hook functionality is designed (mostly) for live video. It allows
the video to be modified or examined between the decoder and the encoder.
Any number of hook modules can be placed inline, and they are run in the
order that they were specified on the ffmpeg command line.
The video hook modules are provided for use as a base for your own modules,
and are described below.
Modules are loaded using the -vhook option to ffmpeg. The value of this parameter
is a space separated list of arguments. The first is the module name, and the rest
are passed as arguments to the Configure function of the module.
The modules are dynamic libraries: They have different suffixes (.so, .dll, .dylib)
depending on your platform. And your platform dictates if they need to be
somewhere in your PATH, or in your LD_LIBRARY_PATH. Otherwise you will need to
specify the full path of the vhook file that you are using.
@section null.c
This does nothing. Actually it converts the input image to RGB24 and then converts
it back again. This is meant as a sample that you can use to test your setup.
@section fish.c
This implements a 'fish detector'. Essentially it converts the image into HSV
space and tests whether more than a certain percentage of the pixels fall into
a specific HSV cuboid. If so, then the image is saved into a file for processing
by other bits of code.
Why use HSV? It turns out that HSV cuboids represent a more compact range of
colors than would an RGB cuboid.
@section imlib2.c
This module implements a text overlay for a video image. Currently it
supports a fixed overlay or reading the text from a file. The string
is passed through strftime() so that it is easy to imprint the date and
time onto the image.
This module depends on the external library imlib2, available on
Sourceforge, among other places, if it is not already installed on
your system.
You may also overlay an image (even semi-transparent) like TV stations do.
You may move either the text or the image around your video to create
scrolling credits, for example.
The font file used is looked for in a FONTPATH environment variable, and
prepended to the point size as a command line option and can be specified
with the full path to the font file, as in:
@example
-F /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf/20
@end example
where 20 is the point size.
You can specify the filename to read RGB color names from. If it is not
specified, these defaults are used: @file{/usr/share/X11/rgb.txt} and
@file{/usr/lib/X11/rgb.txt}
Options:
@multitable @columnfractions .2 .8
@item @option{-C <rgb.txt>} @tab The filename to read RGB color names from
@item @option{-c <color>} @tab The color of the text
@item @option{-F <fontname>} @tab The font face and size
@item @option{-t <text>} @tab The text
@item @option{-f <filename>} @tab The filename to read text from
@item @option{-x <expression>}@tab x coordinate of text or image
@item @option{-y <expression>}@tab y coordinate of text or image
@item @option{-i <filename>} @tab The filename to read a image from
@item @option{-R <expression>}@tab Value for R color
@item @option{-G <expression>}@tab Value for G color
@item @option{-B <expression>}@tab Value for B color
@item @option{-A <expression>}@tab Value for Alpha channel
@end multitable
Expressions are functions of these variables:
@multitable @columnfractions .2 .8
@item @var{N} @tab frame number (starting at zero)
@item @var{H} @tab frame height
@item @var{W} @tab frame width
@item @var{h} @tab image height
@item @var{w} @tab image width
@item @var{X} @tab previous x coordinate of text or image
@item @var{Y} @tab previous y coordinate of text or image
@end multitable
You may also use the constants @var{PI}, @var{E}, and the math functions available at the
FFmpeg formula evaluator at (@url{ffmpeg-doc.html#SEC13}), except @var{bits2qp(bits)}
and @var{qp2bits(qp)}.
Usage examples:
@example
# Remember to set the path to your fonts
FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
export FONTPATH
# Bulb dancing in a Lissajous pattern
ffmpeg -i input.avi -vhook \
'vhook/imlib2.dll -x W*(0.5+0.25*sin(N/47*PI))-w/2 -y H*(0.5+0.50*cos(N/97*PI))-h/2 -i /usr/share/imlib2/data/images/bulb.png' \
-acodec copy -sameq output.avi
# Text scrolling
ffmpeg -i input.avi -vhook \
'vhook/imlib2.dll -c red -F Vera.ttf/20 -x 150+0.5*N -y 70+0.25*N -t Hello' \
-acodec copy -sameq output.avi
# Date and time stamp, security-camera style:
ffmpeg -r 29.97 -s 320x256 -f video4linux -i /dev/video0 \
-vhook 'vhook/imlib2.so -x 0 -y 0 -i black-260x20.png' \
-vhook 'vhook/imlib2.so -c white -F VeraBd.ttf/12 -x 0 -y 0 -t %A-%D-%T' \
output.avi
In this example the video is captured from the first video capture card as a
320x256 AVI, and a black 260 by 20 pixel PNG image is placed in the upper
left corner, with the day, date and time overlaid on it in Vera Bold 12
point font. A simple black PNG file 260 pixels wide and 20 pixels tall
was created in the GIMP for this purpose.
# Scrolling credits from a text file
ffmpeg -i input.avi -vhook \
'vhook/imlib2.so -c white -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
-sameq output.avi
In this example, the text is stored in a file, and is positioned 100
pixels from the left hand edge of the video. The text is scrolled from the
bottom up. Making the y factor positive will scroll from the top down.
Increasing the magnitude of the y factor makes the text scroll faster,
decreasing it makes it scroll slower. Hint: Blank lines containing only
a newline are treated as end-of-file. To create blank lines, use lines
that consist of space characters only.
# Scrolling credits with custom color from a text file
ffmpeg -i input.avi -vhook \
'vhook/imlib2.so -C rgb.txt -c CustomColor1 -F VeraBd.ttf/16 -x 100 -y -1.0*N -f credits.txt' \
-sameq output.avi
This example does the same as the one above, but specifies an rgb.txt file
to be used, which has a custom-made color in it.
# Variable colors
ffmpeg -i input.avi -vhook \
'vhook/imlib2.so -t Hello -R abs(255*sin(N/47*PI)) -G abs(255*sin(N/47*PI)) -B abs(255*sin(N/47*PI))' \
-sameq output.avi
In this example, the color for the text goes up and down from black to
white.
# Text fade-out
ffmpeg -i input.avi -vhook \
'vhook/imlib2.so -t Hello -A max(0,255-exp(N/47))' \
-sameq output.avi
In this example, the text fades out in about 10 seconds for a 25 fps input
video file.
# scrolling credits from a graphics file
ffmpeg -sameq -i input.avi \
-vhook 'vhook/imlib2.so -x 0 -y -1.0*N -i credits.png' output.avi
In this example, a transparent PNG file the same width as the video
(e.g. 320 pixels), but very long, (e.g. 3000 pixels), was created, and
text, graphics, brushstrokes, etc, were added to the image. The image
is then scrolled up, from the bottom of the frame.
@end example
@section ppm.c
It's basically a launch point for a PPM pipe, so you can use any
executable (or script) which consumes a PPM on stdin and produces a PPM
on stdout (and flushes each frame). The Netpbm utilities are a series of
such programs.
A list of them is here:
@url{http://netpbm.sourceforge.net/doc/directory.html}
Usage example:
@example
ffmpeg -i input -vhook "/path/to/ppm.so some-ppm-filter args" output
@end example
@section drawtext.c
This module implements a text overlay for a video image. Currently it
supports a fixed overlay or reading the text from a file. The string
is passed through strftime() so that it is easy to imprint the date and
time onto the image.
Features:
@itemize @minus
@item TrueType, Type1 and others via the FreeType2 library
@item Font kerning (better output)
@item Line Wrap (put the text that doesn't fit one line on the next line)
@item Background box (currently in development)
@item Outline
@end itemize
Options:
@multitable @columnfractions .2 .8
@item @option{-c <color>} @tab Foreground color of the text ('internet' way) <#RRGGBB> [default #FFFFFF]
@item @option{-C <color>} @tab Background color of the text ('internet' way) <#RRGGBB> [default #000000]
@item @option{-f <font-filename>} @tab font file to use
@item @option{-t <text>} @tab text to display
@item @option{-T <filename>} @tab file to read text from
@item @option{-x <pos>} @tab x coordinate of the start of the text
@item @option{-y <pos>} @tab y coordinate of the start of the text
@end multitable
Text fonts are being looked for in a FONTPATH environment variable.
If the FONTPATH environment variable is not available, or is not checked by
your target (i.e. Cygwin), then specify the full path to the font file as in:
@example
-f /usr/X11R6/lib/X11/fonts/TTF/VeraBd.ttf
@end example
Usage Example:
@example
# Remember to set the path to your fonts
FONTPATH="/cygdrive/c/WINDOWS/Fonts/"
FONTPATH="$FONTPATH:/usr/share/imlib2/data/fonts/"
FONTPATH="$FONTPATH:/usr/X11R6/lib/X11/fonts/TTF/"
export FONTPATH
# Time and date display
ffmpeg -f video4linux2 -i /dev/video0 \
-vhook 'vhook/drawtext.so -f VeraBd.ttf -t %A-%D-%T' movie.mpg
This example grabs video from the first capture card and outputs it to an
MPEG video, and places "Weekday-dd/mm/yy-hh:mm:ss" at the top left of the
frame, updated every second, using the Vera Bold TrueType Font, which
should exist in: /usr/X11R6/lib/X11/fonts/TTF/
@end example
Check the man page for strftime() for all the various ways you can format
the date and time.
@section watermark.c
Command Line options:
@multitable @columnfractions .2 .8
@item @option{-m [0|1]} @tab Mode (default: 0, see below)
@item @option{-t 000000 - FFFFFF} @tab Threshold, six digit hex number
@item @option{-f <filename>} @tab Watermark image filename, must be specified!
@end multitable
MODE 0:
The watermark picture works like this (assuming color intensities 0..0xFF):
Per color do this:
If mask color is 0x80, no change to the original frame.
If mask color is < 0x80 the absolute difference is subtracted from the
frame. If result < 0, result = 0.
If mask color is > 0x80 the absolute difference is added to the
frame. If result > 0xFF, result = 0xFF.
You can override the 0x80 level with the -t flag. E.g. if threshold is
000000 the color value of watermark is added to the destination.
This way a mask that is visible both in light and dark pictures can be made
(e.g. by using a picture generated by the Gimp and the bump map tool).
An example watermark file is at:
@url{http://engene.se/ffmpeg_watermark.gif}
MODE 1:
Per color do this:
If mask color > threshold color then the watermark pixel is used.
Example usage:
@example
ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif' -an out.mov
ffmpeg -i infile -vhook '/path/watermark.so -f wm.gif -m 1 -t 222222' -an out.mov
@end example
@bye
......@@ -34,7 +34,6 @@
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
#include "libavformat/framehook.h"
#include "libavcodec/opt.h"
#include "libavcodec/audioconvert.h"
#include "libavutil/fifo.h"
......@@ -203,7 +202,6 @@ static int audio_volume = 256;
static int exit_on_error = 0;
static int using_stdin = 0;
static int using_vhook = 0;
static int verbose = 1;
static int thread_count= 1;
static int q_pressed = 0;
......@@ -736,7 +734,7 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void
dec = ist->st->codec;
/* deinterlace : must be done before any resize */
if (do_deinterlace || using_vhook) {
if (do_deinterlace) {
int size;
/* create temporary picture */
......@@ -764,10 +762,6 @@ static void pre_process_video_frame(AVInputStream *ist, AVPicture *picture, void
picture2 = picture;
}
if (CONFIG_VHOOK)
frame_hook_process(picture2, dec->pix_fmt, dec->width, dec->height,
1000000 * ist->pts / AV_TIME_BASE);
if (picture != picture2)
*picture = *picture2;
*bufp = buf;
......@@ -1772,10 +1766,6 @@ static int av_encode(AVFormatContext **output_files,
codec->block_align= 0;
break;
case CODEC_TYPE_VIDEO:
if(using_vhook) {
fprintf(stderr,"-vcodec copy and -vhook are incompatible (frames are not decoded)\n");
av_exit(1);
}
codec->pix_fmt = icodec->pix_fmt;
codec->width = icodec->width;
codec->height = icodec->height;
......@@ -2651,29 +2641,6 @@ static void opt_video_tag(const char *arg)
video_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);