Skip to content

Instantly share code, notes, and snippets.

@golomidov
Created January 7, 2014 13:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save golomidov/8299654 to your computer and use it in GitHub Desktop.
Save golomidov/8299654 to your computer and use it in GitHub Desktop.
FFmpeg - custom filter addition
//
// ffmpeg_customfilter
// - base name - ainfoda (audio filter)
// - base name - vinfoda (video filter)
//
// 1. create new filein libavfilter/infoda_af.c
// use any filters as template, simplest is af_afnull.c
// filename is arbitrary (all recent named as af_name), but for me all my stuff called with
// unified start as better
/*
---------------------------------------------------------
NAME: avfilter_af_ainfoda
PARAMS:
DESCRIPTION:
---------------------------------------------------------
*/
AVFilter ff_af_ainfoda = {
.name = "ainfoda",
.description = NULL_IF_CONFIG_SMALL("infoda: audio filter"),
.priv_size = sizeof(InfodaContext),
.priv_class = &ainfoda_class,
.init = init,
.uninit = uninit,
.inputs = NULL,
.outputs = NULL,
};
// 2. add to libavfilter/allfilters.c - to the end of similar records
/* infoda filters */
REGISTER_FILTER(AINFODA, ainfoda, af);
REGISTER_FILTER(VINFODA, vinfoda, vf);
// 3. add to libavfilter/Makefile - to the end of similar records
OBJS-$(CONFIG_AINFODA_FILTER) += infoda_af.o
OBJS-$(CONFIG_VINFODA_FILTER) += infoda_vf.o
// after this, if everything ok run
./configure --list-filters |grep infoda
// it should be there
// 3a. if need some dependencies then add to ./configure
ainfoda_filter_deps="libnanomsg"
vinfoda_filter_deps="libnanomsg"
enable libnanomsg
EXTERNAL_LIBRARY_LIST="
...
libnanomsg
// 4. so we can start to compile
./configure --enable-libx264 --enable-openssl --enable-nonfree --enable-gpl
// not required to enable it manually
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment