Cool idea! I first thought that this could be something to make your idea the real thing, but then I realized it requires too much effort. What you want is a simple synchronized background video (preferably funny) generator on any beat you play, right?
Should it be something like an "equalizer" (visualizer), but with predefined videos of known sound characteristics? Almost every music player has the option to play a visualizer along with the music. Its core idea is to correlate visual effects with certain music properties. The most common properties of music used for visualization are loudness and frequency .
So, if you want to correlate funny videos with music, you could just (as you mentioned above) correlate the original music from the video with the one playing at the moment and synchronize them in real time. It could work for simple short videos that have the same repetitive segment that easily correlates with music the same way as it works for visualizers.
The problem is the change in rhythm, the bridges, the outros and other segments of a song that will require fast change in video in order to keep the correlation. These parts could be tricky, especially if you become annoyed by the limited amount of funny video playing as a background and would like to synchronize any video out there.
That's when your idea becomes really different from the existing ones.
The key, in my opinion, is not to match music with original music of the video you want to play as a background, but to find visual characteristics that match the song playing. Sort of a video-to-sound translation and then correlation with the song playing.