It may be the end of the world as we know it in “Knock at the Cabin” (Universal). But, unlike R.E.M.’s Michael Stipe, no one in this offbeat but effective thriller feels fine. Neither will any viewer who comes to the film without the mature discernment needed to sort through its ethically complex content.

The difficulties raised on that score are at least somewhat mitigated, however, by the degree to which the movie departs, from its premise onward, from anything resembling everyday life. Instead, working from Paul Tremblay’s bestseller “The Cabin at the End of the World,” director and co-writer M. Night Shyamalan takes us, quite promptly, to the Twilight Zone.

Vacationing couple Eric (Jonathan Groff) and Andrew (Ben Aldridge) find the country idyll they’ve been sharing with their adopted daughter Wen (Kristen Cui) at the remote dwelling of the title more than rudely interrupted when they’re taken hostage by a quartet of intruders. But this, it soon turns out, is no ordinary home invasion.

As the group’s leader, hulking but seemingly gentle Leonard (Dave Bautista), explains, all four of the interlopers have had matching visions of the impending apocalypse. It’s also been revealed to them that this cataclysm can only be averted if one of their captives is selected by the others to be killed in sacrifice.

As the initially incredulous adult duo try to protect themselves and Wen, TV news bulletins confront them with mounting evidence of worldwide disasters unfolding in rapid succession. They discover as well that their captors are neither habitual criminals nor cultists. Leonard, for example, is a teacher and coach. Could the strangers, in fact, be telling the truth?

Shyamalan builds up the emotional tension, partly through the use of intense close-ups. He also elicits forceful performances that help make the fantastic nature of his main characters’ quandary more believable.

As will already be apparent, however, the revelations mentioned in the script Shyamalan penned with Steve Desmond and Michael Sherman diverge significantly from Biblical prophecy. And, of course, the behavior undertaken in response to them would in any normal circumstances be deeply immoral.

With all that going on, the narrative’s endorsement of the central relationship feels fleeting. But it’s also distinct.

Surveying all these taxing elements, it’s clear that the fitting audience for this eccentric yarn is a scanty one. It certainly does not include youngsters or those grown-ups in search of a mild diversion.

The film contains discreetly handled but harsh violence with some gore, suicide, a benign view of homosexual acts, a few profanities, several milder oaths, frequent rough language and about a half-dozen crude terms. The OSV News classification is L — limited adult audience, films whose problematic content many adults would find troubling. The Motion Picture Association rating is R — restricted. Under 17 requires accompanying parent or adult guardian.

—John Mulderig