Anyone who’s ever heard the shrieks of Florence Foster Jenkins, the opera-loving socialite who insisted on giving recitals despite her manifest lack of talent, will recognize the inspiration behind Xavier Giannoli’s “Marguerite,” a biting yet strangely affectionate period piece about delusion and love. Of course, the fact that the title character’s married name is Dumont shows that the filmmaker’s sources include the Marx Brothers as well. But Groucho, Chico and Harpo would never have allowed one of their movies to drag on for over two hours, as Giannoli does. This is a handsome and sometimes affecting film, but also one that drags toward the close.

The title figure, played by Catherine Frot, is a wealthy French baroness who holds private concerts that raise funds for worthy causes like the care of children orphaned by World War I. After performances by gifted musicians like young soprano Hazel (Christa Theret), Marguerite herself appears, carefully costumed in carefully prepared, near-regal splendor, and sings such demanding coloratura pieces as the Queen of the Night’s arias from Mozart’s “Die Zauberflote.” Unhappily, she’s terrible, scooping her way through difficult passages with sounds that are positively painful to listen to. But she’s blissfully unaware of that; the sounds she hears in her mind are not those that emerge in reality. The invited audiences stifle their titters, accustomed it seems to her out-of-tune efforts. But her industrialist husband Georges (Andre Marcon), a genteel philanderer, has grown so embarrassed over her extraordinarily exhibitions that he deliberately fails to appear in time for her latest program, claiming that his car had broken down.

Still, Madame proceeds even in his absence under the watchful eye of her devoted, endlessly supportive butler Madelbos (Denis M’Punga), whom one can’t help comparing to Max, the absurdly loyal factotum to Norma Desmond played by Erich von Stroheim in “Sunset Boulevard.” Unbeknownst to him—or to Marguerite and Georges—the concert is also attended by a couple of gate-crashers: Lucien (Sylvain Dieuaide), an acerbic critic, and his anarchist buddy Kyril (Aubert Fenoy). The latter seizes on what he perceives as Marguerite’s unintentional revelation of social hypocrisy, and Lucien follows up with a wry review in which he extols the truthfulness of her voice.

Though Madelbos carefully buries negative articles (while also recording his mistress’ progress in carefully-composed photographs), Marguerite gets hold of Lucien’s and immediately goes to his office to thank him. Kyril intervenes to persuade her to make a public appearance at a Dadaist event he’s putting together, where she screeches out the “Marseillaise” amidst jeers and catcalls that rival those Roseanne invited in her infamous performances of the national anthem. The event might have been a scandal, but it persuades Marguerite not only to plan a recital in the opera House, but to prepare for it by hiring Pezzini (Michael Fau), an over-the-hill tenor, as her vocal coach. Though he’s dismayed by her obvious lack of talent, Pezzini’s need of money—and some threats from Madelbos—persuade him to decamp to the estate with his eccentric retinue in tow while the incredulous Georges looks on. The entire episode comes across like a parody of the Susan Alexander plot thread from “Citizen Kane.”

Though there are missteps along the way, in its main narrative thread “Marguerite” is mostly deft in walking a fine line between farce and tragedy. On the one hand it avoids simply ridiculing the needy, childishly ebullient baroness, and on the other it refuses to make her a totally pathetic figure. True, the attempt to portray her insistence on singing as something not derived merely from her inordinate love of music but also from a desire to make Georges love her never fully convinces, and the concluding post-concert scenes come perilously close to bathos (as well as making Madelbos’ motives opaque).

But the real weakness of the film lies in the subplot. Lucien’s romantic pursuit of Hazel, which Giannoli tries to make some sort of parallel to the relationship between Marguerite and Georges, seems like an afterthought that never gels, and as played by Dieuaide and Theret, the characters are a pallid pair. Frot, however, makes Marguerite touchingly infantile, though slightly haughty too, and while Marcon doesn’t match her, he does bring intensity to his final scenes. M’Punga, moreover, cuts a striking figure as Madelbos. Meanwhile Fau has a grand old time hamming it up as the avaricious, unprincipled Pezzini and Fenoy has fun as Kyril as well; they bring a welcome vivacity to a picture that otherwise is a mite too measured for its own good—even if editor Cyril Nakache is taking his cue from the directorial approach.

Visually, moreover, “Marguerite,” with its emphasis on alabaster sheen, is a treat, with Martin Kurel’s production design, Pavel Tatar’s art direction, Veronique Melery’s set decoration and Pierre-Jean Larroque’s costumes all spectacular. Glynn Speeckart’s widescreen images take full advantage of the sumptuous locations, and the musical side of things (including Ronan Maillard’s score) fully complements them, if you set aside Marguerite’s deliberately painful sounds, of course.

Giannoli’s film is essentially a bauble that strains for some dramatic depth with only partial success. But opening with a lovely rendition of Purcell’s “Come Ye, Sons of Art,” it makes that an invitation music lovers in particular should embrace.

A final note of interest: Meryl Streep and Stephen Frears are collaborating in a film about Florence Foster Jenkins herself. It will make an intriguing companion piece to “Marguerite.”