Magic is inspired by ffmpeg's probe function in libavformat/bink.c
probe
pretty popular for video sequences in old games :)