ffmpeg Makefile to enable CUDA for scientific libavfilter on EC2?

I’ve written a filter for ffmpeg that needs to look at over 80mln pixels for each frame. This seems like something that CUDA would help with, specifically on Amazon’s EC2 Linux GPU cluster box. I got 3.8x the bandwith using OpenMP on a 4-core i7, so maybe CUDA would be even better. I ran the profiler, and for this task, 90+% of the processing time is in my filter.

I’ve seen many people asking about CUDA for decoding with ffmpeg and many other people explaining the problems using GPU power for that, but has anyone figured out how to tweak or avoid the Makefile to enable CUDA in the filters library? On Linux?

Addendum: The data is only 1920x1080 pixels, 1 greyscale byte per pixel–I just need to look at each pixel 40-50 times.

Figured it out, sharing for anyone else who wants it. I’m assuming at this point that a definition for the new filter is already created, CONFIG_MYFILTER_FILTER in this example, and that this already exists in config.h, config.mak, and config.asm after ./configure was run.

in config.mak
LDFLAGS=-L/usr/local/cuda/lib (and other options)
EXTRALIBS=(other options, and ) -lcudart

in common.mak
nvcc -I/usr/local/cuda/include $(CPPFLAGS) -Xcompiler “$(CFLAGS)” -c -o libavfilter/vf_myfilter_cu.o libavfilter/vf_myfilter_cu.cu

In libavfilter/Makefile
OBJS=$(CONFIG_MYFILTER_FILTER) += vf_myfilter_cu.o