Have a look at
BEFA. Documentation is japanse, but it seems like it does what you need.
Befa( int freq, int sec, int dftsize, int bandwidth, int fade, bool window )
MJPEG is actually YV12, but I haven't found a good codec for it yet. Morgan MJPEG seems good, but it has a very stupid FieldDoubling bug in YV12 mode, besides swapped UV channels. I have written Morgan about the problem, but with no response.
Anyway, since I also use MJPEG for transfers, I use:
Avisource("file.avi",pixel_type="yuy2")
or
DirectShowSource("file.avi")
AviSource produces YUY2 input, and DSS produces YV12. In either case it is a good idea to end your script with converttorgb24().