I think this is a movie from the late 60s/early 70s that had a gothic, hammer-horror feel, it might have been British. It was in color.
The story was about an 18th-century scientist who develops some type of ray, or machine that reveals these winged, banshee-like creatures that fly into people at the moment of death, stealing away their souls (or something).The scientist then develops a way to trap the creatures, which prevents death from happening. There was some drama between him and two other people – a man and a woman, and at the end the scientist traps his own death demon, and somehow destroys it (I think), thereby living forever. The last scene is of the scientist 100 years later, living in the current time, remembering the story and walking around the city withered and very old, unable to die.
I remember seeing this on some horror movie feature show that was around in the 80s. It’s creeped me out ever since.