Love was in the air Wednesday at the Cannes Film Festival, when Scottish helmer Lynne Ramsay got hitched at an impromptu ceremony on an old yacht.

The boat sailed 12 miles into international waters, so the captain could officiate. Jim Wilson, the deputy head of production at FilmFour who made his thesping debut in Ramsay’s “Morvern Callar,” gave the bride away. Bridesmaids included the pic’s star Samantha Morton, co-writer Liana Dognini and producer Robyn Slovo.

New hubby Rory Kinnear is non-pro (“He’s gonna be a pop star,” says Ramsay adoringly).

The whole event took place on the spur of the moment. “We didn’t find out it was possible until 1 p.m., and we went an hour later,” giggles Ramsay. “I just wanted to get away from Cannes, and we said let’s do it. It was really peaceful.”

Except that proceedings were punctuated throughout by loud moaning from a nearby island, where a porn film was being shot in full view of the boat.

“It was like Fellini film,” says Ramsay, who wore a 1950s red and white dress. “It was emotional and surreal,” says Wilson. “It was the best production I saw in Cannes — apart from our own films, of course.”