During the many years Nadine Labaki spent doing the research necessary to make “Capernaum,” visiting children’s detention centers and juvenile courts in Lebanon to understand the plight of an entire generation that had fallen through the cracks of the system – without the proper paperwork to acknowledge their citizenry or even birth, and often without parents who could support them – she always would bring the interviews around to one question in particular.

“I used to ask them at the end of the conversation, ‘Are you happy to be alive?’” Labaki recalled recently at AFI Fest in Los Angeles, initially inspired to make “Capernaum” after seeing a mother and her infant child isolated on a concrete island in the middle of a busy thoroughfare, making a home in constant peril. “And unfortunately in most cases, the answer would be ‘No. I don’t know why I’m born if nobody’s going to love me and I’m going to be abused, if I’m going to be raped, if I’m going to be beaten up every day, if I’m never going to hear a nice word.”

Labaki turned that sense of defeat into a rallying cry for her young protagonist Zain in her ferocious third directorial outing as the boy feels he has no recourse but to sue his parents for giving birth to him. The premise of such a court case may be extreme, but it’s proportionate to the sense of righteous outrage that fuels “Capernaum” as well as its enormous capacity to create empathy, the result of an extraordinary production in which Labaki could only enlist her husband Khaled Mouzanar, a composer by trade, to act as her producing partner since the demands of the shoot were too daunting to ask of anyone else.

After tackling the logistical challenges of a musical with the internationally acclaimed crowd pleaser “Where Do We Go Now?” Labaki sets her sights even higher with her exhilarating latest, filming “Capernaum” as one would approach a documentary, amassing hundreds of hours of footage of her nonprofessional cast to present them at their most unguarded. With a commitment to authenticity that led her to bring in a real judge to preside over the film’s trial, the writer/director was adamant about only setting up the circumstances in which she could film while letting her cast loose, giving the film an undeniable realism and energy as it follows Zain (Zain Al Rafeea) after he leaves his family in anger over their decision to marry off his 11-year sister Sahar (Cedra Izam) to much older man in the neighborhood and ultimately finding shelter with Rahil (Yordanos Shiferaw), an Eritrean refugee in as precarious a position as Zain, at the mercy of a local vendor named Aspro (Alaa Chouchnieh) who supplies her with fake IDs to stay in the country and has a baby boy (Boluwatife Treasure Bankole) to care for.

Labaki wasn’t only making a film, but in casting people off the streets of Lebanon whose lives strongly resembled who the characters they play in the film, she has managed to capture the reality of their situation in front of the camera while changing the narrative off of it, sponsoring Shiferaw, who was arrested during production over her immigration status, so she could remain in Lebanon, and working with the United Nations Refugee Agency to put Al Rafeea, Izam and their families, among others, on the path to new lives. It’s perhaps the only thing that may be more moving than what Labaki, firmly establishing herself as one of the world’s great filmmakers, has achieved on screen in “Capernaum” and while in Los Angeles, she spoke of navigating a shoot where she was always inviting the unpredictable into the frame, how motherhood has informed her filmmaking and the personal toll the film has taken.

 Zain Al Rafeea in "Capernaum"How much of a script did you start out with?

It was a very solid script to start with, based of course on four years of research, so we knew where we were going and the arc of the film, but during the process of filming, we knew it was going to take a long time, so we filmed for six months — 500 hours of rushes — because working with actors who are not professional, people who are almost living the same situation as [they portray] in the film, we knew from the start that we had to be free in the sense that if something happens outside what is written, we shouldn’t be afraid of it. We should embrace whatever life was going to give us, so it was always this negotiation between reality and fiction. They weren’t acting. It’s impossible for them to memorize lines, [and besides] then it would be fake, I think, that I [presume to] know better than they do and to impose certain dialogue on them, so [once we cast] I adapt this base to their personality if they need to change or add something. Of course, I was waiting for those moments because it gives you the impression that you’re not making a film, you’re actually capturing life. They were just being who they are and [we were] navigating it towards the fiction that we had written [which] was always important because we need to tell this specific story.

Naturally, much attention has been paid to how you found Zain, but an equally difficult role to cast must’ve been who plays his sister Sahar since she has to leave an impression that stays with you for the rest of the film. How did you find Cedra Izam?

She was a child that was unfortunately selling gum on the street, so she’s exactly playing the same role [as she does in the film]. It was street casting, so [our casting directors] would go everywhere and film kids in those difficult neighborhoods, and they found her and she came to the office when we were preparing the production house and as soon as I saw her, I knew the sadness in her eyes was something that was unbearable to watch. She has such wisdom towards what’s happening to her in her real life, so it’s as if you can’t escape it, [and I knew] that she should be Sahar in the film. Like everyone else in the film, at some point, you know you’re making the right choice, even if you know it’s going to be very hard because they don’t have any experience.

 Zain Al Rafeea and Cedra Izam in "Capernaum"What was it like shooting on the streets? That seems like a wild endeavor.

Very wild, but very exciting because you feel like you’re really part of it. You’re immersed in this reality. There were so many amazing things that happened, let’s say when we were shooting in the Souk. Those scenes of Aspro talking to Rahil or to Zain [in the middle of the marketplace], there’s no extras. You decide on your camera position and then you just shoot everything’s that’s happening and the people passing by. And sometimes people would enter the frame and buy things from Aspro while he’s talking to Zain — he would negotiate the price with them, sell them stuff and then they would go on with their lives — and we’d continue the scene. A lot of times Zain would actually stand there and wait for the guy to finish, so it’s fascinating to see how well we blended to the point where people didn’t see us anymore. I never had to ask somebody not to look in the camera. And it was fascinating [because] how can they not look? We became invisible in a way.

Was this a relatively small camera crew you were keeping?

Two cameras with two crews, but we tried to keep it as small as possible. Not as small as I wanted it to be because we had two camera crews, two sound crews so obviously you have to have control, but we blended so well. Maybe we were 40, 50 people [total].

You’re able to create all these incredible montages throughout the film that give it so much life. Was that something you were conscious of to capture or did you amass so much footage that became one of the best ways to tell the story?

It was a mixture of both. Sometimes we would be in a certain scene and then something would happen and I would say, “Okay, let’s go shoot this because I think it’s a good idea to have it in the film.” You have to have a crew that is able to follow you on this crazy adventure and not put sticks in the wheels every time you want to change something. So everybody was already ready to just do the impossible, and sometimes we’d be shooting a certain scene and then we’d have an idea to shoot something else and then we’d leave it and go shoot something else and so we had those moments where we would on the spot decide to do several things that were not supposed to happen.

 Zain Al Rafeea and Nadine Labaki in "Capernaum"You’ve said you actually had more of an on-screen role as Zain’s lawyer before cutting it back…

Cut everything almost, yeah. [laughs]

Was the trial at one point a bigger part of the film?

There was much more of the trial. And I’m still not sure if I made the right choice by cutting it so much. As a filmmaker, I think all of us feel the same where we don’t have enough distance with what we’re doing. We’re never going to discover the film as any viewer who sees this film for the first time. And I did everything to try to see this film in a different perspective. I even tried hypnosis. I went to a friend of mine saying, “Can you really make me forget everything and just watch this film as if I’m seeing it for the first time?” And she said, “No, obviously not. You’re crazy. You cannot do this.” [laughs] So there’s a lot of things that are not in the film anymore, but I cannot tell you this was the right decision.

Your husband joked about resisting your calls to start working on the music when an assembly cut might’ve been seven hours long. At what point can he start putting a score together?

[laughs] It was very, very hard endeavor working on the music because we really had to find the right dosage and not to feel manipulative in any way. Even though I love what music does to me when I’m watching films, I was scared [because] I didn’t want to alter the reality, so it was a back-and-forth negotiation the whole time, like where should the music come in, where should it not, and where should we add to the emotions and where should we be more modest. I’m happy with the result, but it was very, very difficult for him too because he had to really let go of a lot of music he had written for the film.

 Zain Al Rafeea in "Capernaum"When we spoke about “Where Do We Go Now?” you mentioned the inspiration was in relation to the birth of your child. With this film about children, does motherhood continue to inform your filmmaking?

Absolutely. Everything informs everything, and the fact that I was at that point in my life going through the same thing [as Rahil], breastfeeding my child, it was a mirror with what’s happening with the child [Treasure], so there’s something there that gives you the confidence and that tells you exactly when to shoot, what to shoot, how Treasure is going to react – because you’re working with pure souls. You’re working with raw nature and everything [Treasure] does make sense, so you just have to create the right situation for her. And I knew exactly when to film her when she was sleeping or even when she was going to put her hand on her mother’s breast. It was a visceral relationship and every time she would enter the set, I would see my daughter. So this, I think, is the experience of being a mother and going through it at the same time. And sometimes it was amazing when [Rahil] was breastfeeding her baby, I also had milk coming up. [laughs]

And it seemed to me like there’s this entire process parallel to the production of making sure all the actors can be safely resettled after the production, which is ongoing. What is it like taking on that responsibility?

For me, it’s impossible not to feel this responsibility. They’re all a part of your family. Each one of them. So it’s not a choice. And it’s part of what the film is saying. I cannot [make the film] and just forget about everyone. It’s a continuation of the film. You’ve worked with them for so long, you know them so well and you know their struggle, so it’s my duty to help and Zain is resettled, and now everyone is in school. There’s no one selling gum on the street anymore. But of course, it’s difficult. It’s not ideal yet. Zain’s situation is ideal, but we’re slowly working on each situation.

Yordanos Shiferaw in "Capernaum"After carrying this with you for so long, what’s it like getting it out into the world?

It’s a blessing to see how people are reacting to the film. I knew it in a way, it’s impossible for people not to react like this because I knew the intention that was put in the film and I worked very hard, so somehow I knew it was impossible for people not to connect with the film. But I’m destroyed, actually. [laughs] there isn’t one person on this film that didn’t give everything – everything – they had. Even physically, we changed. My cinematographer lost his beard, like he had pieces of his beard come off. My editor has problems with his eyes now. My husband’s beard is all white. It was such a difficult adventure, but everybody feels rewarded in a way. This film changed us forever. It changed us emotionally forever. You don’t look at things the same way. You don’t make films the same way.

“Capernaum” opens on December 14th in Los Angeles at the Laemmle Royal and in New York at Film Forum and the Landmark at 57 West.