In the “Formation” video, a black man wearing a yellow T-shirt and a black Stetson rides a horse through a deserted alley, edged with shrubs and red brick walls; his white Adidas sneakers are fitted with spurs. The scene was inspired by Matsoukas’s maternal grandfather, Carlos, an Afro-Cuban preacher and musician, known to friends as “the Cuban Nat King Cole,” who rode in rodeos in Harlem and the Bronx. “We’d see him on his white horse, and he was just this regal-looking black cowboy,” she recalled. Her maternal grandmother was a Cuban maid, who brought her six children from Havana to New York after the revolution. Matsoukas’s paternal grandparents were Greek and Polish Jews living on the Upper West Side. Her parents, David and Diana-Elena, met through one of Diana-Elena’s brothers, who had encountered David in a socialist student group.

Matsoukas was born in 1981 and grew up in Co-op City, a sprawling housing development in the Bronx. Her father worked as a carpenter, and her mother taught math in a local high school. When Matsoukas was eight, the family moved to Hackensack, New Jersey, but as a teen-ager she often returned to the city to go clubbing. “I was just trying to be grown,” she recalled. “Young girl trying to do too much.” She read Malcolm X and Assata Shakur, and listened to socially conscious hip-hop by Rakim and A Tribe Called Quest. “She’s always been an old soul, and she’s always been confident,” her mother told me. “I sometimes had to remind her, ‘Melina, I’m the mother here.’ ”

In high school, Matsoukas began taking photographs—including portraits of her friends, dressed in Afrocentric clothing—and she went on to study film at N.Y.U. and cinematography in the graduate program at the American Film Institute. She admired the directors Spike Lee and Mira Nair, and imagined making films that documented the lives of people “who look like me and think like me.” Her college thesis was a music video featuring a friend who was a singer, filmed on the subway and in an apartment building in the Bronx that her father owned.

Her first paid gig—two hundred and fifty dollars—was a video for a song called “Dem Girls,” by her cousin the rapper Red Handed, in Houston. “It was just in the hood, doing hood stuff,” she said, laughing. The result, which featured an assortment of preening video girls, was distinguished less by its imagery than by its precise focus and framing. Matsoukas shot in black and white, with split screens showing contrasting views of the same scene: gold-chained rappers playing dominoes set against children running through the grass.

After she finished graduate school, an agent named Inga Veronique got her a job directing a video for Ludacris and Pharrell. The song was a strip-club anthem called “Money Maker” (“Shake your money maker like somebody ’bout to pay ya”), but, Matsoukas said, “I wanted it to feel rich.” Borrowing from fashion photography, she posed models in front of bright-colored backdrops and lit them as if for a photo shoot; to accompany one chorus of the song, she created a montage of gleaming watches, sunglasses, and stacks of cash. Veronique said that the video was “fashion-y without beating you over the head with fashion.” The song went to the top of the hip-hop charts, and the video drew attention from the industry.

In 2006, on the night of the MTV Music Video Awards, Matsoukas met Jay Z and Beyoncé at a club in New York, and Jay Z hailed her as a rising star. Matsoukas shook Beyoncé’s hand and told her, “I’m coming for you.” Two months later, Camille Yorrick, a record executive who worked with Beyoncé, called to ask Matsoukas to direct four videos for a forthcoming album. “I had only done four videos in my whole life!” Matsoukas said. “I was really scared.” Still, her work appealed to artists’ managers. “The thing that stood out to me about her early videos was the way she made people look,” Yorrick said. “She just made them look really beautiful—people of color, white people, it didn’t even matter.”

As Matsoukas made videos for such singers as Whitney Houston and Jennifer Lopez, she often relied on highly stylized settings. Generic lyrics could yield generic imagery: she set Lady Gaga’s “Beautiful, Dirty, Rich” in a moodily lit mansion filled with piles of money, and Robin Thicke’s “Sex Therapy” in a moodily lit mansion filled with acquiescent models. Her videos were often less concerned with narrative than with what the film theorist David Bordwell has called “world making.” Unlike other directors, she selects the wardrobe for a video, and creates mood boards of clothes and accessories for her performers. “Fashion is as much a character in her work as everyone else,” Yorrick said. She is also unusually capable of coaxing performances out of musicians. “She knows what she wants, and she knows how to command a set,” Yorrick went on. “She’s a negotiator—she negotiates her way to the best product.” Beyoncé said of Matsoukas in an e-mail, “She is a force, deliberate and methodical.”

When Snoop Dogg asked Matsoukas to make a video for a song called “Sensual Seduction,” in 2007, she took the job with trepidation. A few years earlier, Snoop had released a film, called “Doggystyle,” that blended hip-hop and pornography. “You walk into that kind of situation and you’re, like, ‘He’s a pimp—I don’t know how he’s going to react to a female director,’ ” Matsoukas said. She envisioned a video that was radically at odds with Snoop’s usual work: an early-eighties throwback, in which he would dress up in outrageous suits and wigs and perform with a keytar. She won him over, she said, with playful enabling: “In order to make artists feel comfortable in a space they’re not normally comfortable with, I go along for the ride.” By mid-shoot, she had Snoop shirtless and dancing. “I remember being, like, ‘Well, we want to attach this weave to your beard,’ and he was, like, ‘Sure, glue it on,’ ” she said.

In 2011, Rihanna asked Matsoukas to make a video for a song called “We Found Love.” By then, Matsoukas had grown tired of making videos that simply conjured a mood. “I had done a lot of performance-based stuff, and I just wanted to tell stories,” she said. She admired David Fincher’s work with Madonna, which felt like four-minute melodramas, and she was drawn to experiments like Prodigy’s “Smack My Bitch Up,” a cinéma-vérité chronicle that follows a drunken, coked-up lowlife through a night out in London—fighting, vomiting, groping women—until, in the last scene, the lowlife is revealed to be a woman.

Matsoukas drew up a treatment for Rihanna, which evoked “Romeo and Juliet” and “Requiem for a Dream”: a depiction of a relationship charged with drug-fuelled passion and domestic violence. To play the male lead—“that man we all want but we know we shouldn’t fuck with,” Matsoukas said—she found an amateur boxer from London named Dudley O’Shaughnessy. On the set, a farm near Belfast, the chemistry between Rihanna and O’Shaughnessy arose out of improvisation. Before the first scene, Matsoukas recalled, Rihanna “was in her trailer getting ready, and he was on set waiting, and of course we were behind. So when she came out there was no time for formal introductions. It was, like, ‘O.K., take her hand and run, and get lost in it.’ And then I was, like, ‘And if you feel like it, maybe kiss her.’ And he did—they kissed on the first take.”

Two years before the shoot, Rihanna’s boyfriend, Chris Brown, had assaulted her in a car, and pictures of her bruised face had filled the tabloids. Rihanna’s fans saw an uncanny resemblance between Brown and O’Shaughnessy. Matsoukas denied that the resemblance was intentional, saying only that the video “was based on my terrible love life and obviously her terrible love life and every woman’s terrible love life.” Nevertheless, the violence of the onscreen relationship can feel unsettlingly reminiscent of Rihanna’s real-life assault. “She was open to taking it there,” Matsoukas said, “and with being honest and showing what life really is.”