THERE are 16 shots in Lars von Trier’s hauntingly beautiful overture to “Melancholia,” a movie about love, family and the apocalypse. The movie, among Mr. von Trier’s greatest, stars Kirsten Dunst as Justine, a young advertising copywriter who, shortly after she gets married endures two separate yet related catastrophes: A wedding party at an oceanside golf resort owned by her brother-in-law ends with her new husband leaving. This in turn brings on the depression that overtakes her and seems to inaugurate the end of the world or her dream of the same. Many of the movie’s themes are introduced in the first eight minutes, a masterpiece in miniature that is a palimpsest of literary, artistic and cinematic allusions.

1A. The movie opens with a fade from black to a close-up of Justine’s head, with a bit of her neck. Her eyes are closed, and her head is slightly to the left of the center of the frame, with the rest of the image taken up by a gray-white sky streaked with pink. She slowly opens her eyes, her gaze directed at the camera (and us), her face impassive. As soon as her eyes are opened, dead birds begin falling from the sky like stones, an intimation of the disaster(s) to come.

1B. On the soundtrack the exquisite prelude to Wagner’s opera, “Tristan and Isolde” (completed 1859), begins to play. Wagner described the opera as “one of endless yearning, longing, the bliss and wretchedness of love; world, power, fame, honor, chivalry, loyalty and friendship all blown away like an insubstantial dream,” for which there is “one sole redemption — death, finality, a sleep without awakening.”

1C. Ms. Dunst’s character shares her name with the title figure in the Marquis de Sade’s 1787 novel “Justine,” about a virtuous woman who endures a crucible of suffering and, after being reunited with her sister, Juliette, is fatally struck by lightning. Mr. von Trier has expressed interest in adapting the novel, and it was one of the inspirations for his 1996 feature, “Breaking the Waves,” in which Emily Watson plays a doomed, sexually exploited, saintlike figure. “In the end,” Mr. von Trier said in a 1996 interview, “Justine thanks God for his goodness in letting her survive all the calamities — after which she is struck by lightning and burns to death.”