I’m trying to identify this movie for 15 years. I saw it on television in the nineties. None of the below mentioned details are sure, any of them can be a false memory.
The movie has some Scandinavian flavour and takes place in an overall gloomy, misty, muddy, dirty and barren land, looking something like Northern Europe in winter. The era is sometime around the 16-18. century.
The first part of the movie revolves around a middle aged man, who has beard and/or moustache and wears a big black hat, and has a raven. Or doesn’t have a raven but himself is called Raven because of his big black hat? He is, or said to be some kind of a wizard, but shows little sign of it. He desperately tries to get into or to get something from a walled village. The village is a very rundown, muddy place and it has a big, round pool in the middle, its edge slightly raised from the ground, with a low wooden or mud wall on its perimeter, full of disgusting waste to its brim. The man with the hat could not enter the village.
A bit later the man is already old and maybe blind, and has a young companion. They young guy maybe gets captured by the villagers and gets tied at the side of the waste pool. He makes a trick, making the big ugly boss of the village believe that there is something valuable in the waste pool, and manages to drown the boss.
After that, the young guy has a lover, and they are expecting a baby (or not). They somehow get separated. The guy tries to find the woman, who meanwhile gets married to a high ranking man, some kind of governor, or military person, maybe for the benefit of her newborn baby (or not).
The guy reaches the sea, and finds a big old wreck of a sailing ship on the beach. For some reason he decides to repair it, unsuccessfully. Guy gets locked up in prison somehow. The woman visits the prison with her child, probably because she finds out that the guy is there. In the final moments of the movie, the guy climbs the high stone walls of the prison, higher and higher, and finally disappears or flies away, or something like that. The end.