diff --git a/overlays/ffmpeg-foodogsquared/add-custom-filters.patch b/overlays/ffmpeg-foodogsquared/add-custom-filters.patch index b1323546..4887ab71 100644 --- a/overlays/ffmpeg-foodogsquared/add-custom-filters.patch +++ b/overlays/ffmpeg-foodogsquared/add-custom-filters.patch @@ -1,26 +1,26 @@ diff --git a/libavfilter/Makefile b/libavfilter/Makefile -index a90ca30ad7..c0fc73be46 100644 +index 30cc329fb6..02b4c75470 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile -@@ -367,6 +367,7 @@ OBJS-$(CONFIG_YADIF_FILTER) += vf_yadif.o +@@ -549,6 +549,8 @@ OBJS-$(CONFIG_YAEPBLUR_FILTER) += vf_yaepblur.o OBJS-$(CONFIG_ZMQ_FILTER) += f_zmq.o OBJS-$(CONFIG_ZOOMPAN_FILTER) += vf_zoompan.o OBJS-$(CONFIG_ZSCALE_FILTER) += vf_zscale.o -+OBJS-$(CONFIG_GLTRANSITION_FILTER) += vf_gltransition.o -+OBJS-$(CONFIG_SHADERTOY_FILTER) += vf_shadertoy.o ++OBJS-$(CONFIG_GLTRANSITION_FILTER) += vf_gltransition.o ++OBJS-$(CONFIG_SHADERTOY_FILTER) += vf_shadertoy.o OBJS-$(CONFIG_ALLRGB_FILTER) += vsrc_testsrc.o OBJS-$(CONFIG_ALLYUV_FILTER) += vsrc_testsrc.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index 6eac828616..0570c1c2aa 100644 +index 5ebacfde27..9053f030fb 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c -@@ -357,6 +357,7 @@ extern AVFilter ff_vf_yadif; +@@ -516,6 +516,8 @@ extern const AVFilter ff_vf_yaepblur; extern const AVFilter ff_vf_zmq; extern const AVFilter ff_vf_zoompan; extern const AVFilter ff_vf_zscale; +extern const AVFilter ff_vf_gltransition; +extern const AVFilter ff_vf_shadertoy; - + extern const AVFilter ff_vsrc_allrgb; extern const AVFilter ff_vsrc_allyuv; diff --git a/overlays/ffmpeg-foodogsquared/default.nix b/overlays/ffmpeg-foodogsquared/default.nix index 8ed6e7c0..571a950f 100644 --- a/overlays/ffmpeg-foodogsquared/default.nix +++ b/overlays/ffmpeg-foodogsquared/default.nix @@ -5,25 +5,43 @@ let owner = "transitive-bullshit"; repo = "ffmpeg-gl-transition"; rev = "3639b521aafb30b185de281f94560f298a22d420"; - hash = ""; + hash = "sha256-py6NVXw3giiRAcVRzsgxU8aKJZInWrubIUT2vOhfuco="; + name = "ffmpeg-gltransition"; }; - ffmpegShadertoyFilter = prev.fetchFromGitLab { + ffmpegShadertoy = prev.fetchFromGitLab { owner = "kriwkrow"; repo = "ffmpeg_shadertoy_filter"; rev = "eb297df10a104cae2d4ef3f70188d1e84f104532"; - hash = ""; + hash = "sha256-Qy5sZgNF/0uNCosj2NZEvyssXU9ln6ZsDjnt/orpt1k="; + name = "ffmpeg-shadertoy"; }; in { ffmpeg-foodogsquared = prev.ffmpeg-full.overrideAttrs (finalAttrs: prevAttrs: { pname = "ffmpeg-foodogsquared"; + srcs = [ + prevAttrs.src + ffmpegGLTransitions + ffmpegShadertoy + ]; + buildInputs = prevAttrs.buildInputs ++ (with prev; [ + libGLU + glew + ]); + sourceRoot = "."; patches = prevAttrs.patches ++ [ ./add-custom-filters.patch + ./update-ffmpeg-opengltransition.patch ]; - postPatch = prevAttrs.postPatch + '' - cp ${ffmpegGLTransitions}/vf_gltransition.c $src/libavfilter - cp ${ffmpegShadertoyFilter}/vf_shadertoy.c $src/libavfilter + postUnpack = '' + cd ./${ffmpegGLTransitions.name} + cd ../ + + cp --no-preserve=mode ./${ffmpegGLTransitions.name}/vf_gltransition.c ./ffmpeg/libavfilter + cp --no-preserve=mode ./${ffmpegShadertoy.name}/vf_shadertoy.c ./ffmpeg/libavfilter + + cd ffmpeg ''; }); } diff --git a/overlays/ffmpeg-foodogsquared/update-ffmpeg-opengltransition.patch b/overlays/ffmpeg-foodogsquared/update-ffmpeg-opengltransition.patch new file mode 100644 index 00000000..8b277231 --- /dev/null +++ b/overlays/ffmpeg-foodogsquared/update-ffmpeg-opengltransition.patch @@ -0,0 +1,20 @@ +diff --git a/libavfilter/vf_gltransition.c b/libavfilter/vf_gltransition.c +--- a/libavfilter/vf_gltransition.c ++++ b/libavfilter/vf_gltransition.c +@@ -133,7 +133,6 @@ static const AVOption gltransition_options[] = { + { "duration", "transition duration in seconds", OFFSET(duration), AV_OPT_TYPE_DOUBLE, {.dbl=1.0}, 0, DBL_MAX, FLAGS }, + { "offset", "delay before startingtransition in seconds", OFFSET(offset), AV_OPT_TYPE_DOUBLE, {.dbl=0.0}, 0, DBL_MAX, FLAGS }, + { "source", "path to the gl-transition source file (defaults to basic fade)", OFFSET(source), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, +- {NULL} + }; + + FRAMESYNC_DEFINE_CLASS(gltransition, GLTransitionContext, fs); +@@ -570,7 +569,7 @@ AVFilter ff_vf_gltransition = { + .preinit = gltransition_framesync_preinit, + .init = init, + .uninit = uninit, +- .query_formats = query_formats, ++ .query_formats = FILTER_QUERY_FUNC(query_formats), + .activate = activate, + .inputs = gltransition_inputs, + .outputs = gltransition_outputs,