As Europe faces its largest migrant crisis since World War II — more than 780,000 people from the Middle East and Africa have arrived this year, according to the United Nations’ refugee agency — it can be easy to forget that there is a story behind each decision to attempt the difficult journey.

There could hardly be a more apt moment for the release, in Europe this fall and winter and in the United States next week, of “Mediterranea,” the first full-length feature film by the writer-director Jonas Carpignano.

The documentary-style film is a snapshot of two men — Ayiva, played by Koudous Seihon, and Abas (Alassane Sy) — who travel from Burkina Faso in West Africa to Rosarno in Italy’s southern Calabria region, seeking better lives. A composite of many migrant experiences, “Mediterranea” grew from Mr. Carpignano’s friendship with Mr. Seihon, 29, and was inspired by Mr. Seihon’s life.

Although the film focuses on economic migrants who left their countries before the current influx, not refugees fleeing war, the timing of its message is remarkable. It is sure to resonate strongly as the crisis broadens on a continent that, Mr. Carpignano said, needs greater “compassion for people trying to get out of a dangerous situation.”

A scene from “Mediterranea,” a documentary-style film focusing on two men who travel from Burkina Faso in West Africa to Italy’s southern Calabria region. Credit Haut et Court DistributionAyiva and Abas are in Algeria as the film opens, and their onward journey with a few dozen men and women seesaws between the surreal and the horrific. They face bandits in the North African desert, and in Libya their handlers abandon them to captain their own boat to Europe. After a harrowing ocean crossing, Ayiva and Abas reach Italy, though others in their group do not survive. The rest of the film traces their precarious existence in Calabria.

Though “Mediterranea” is sensitive to its protagonists, no one is idealized. Arriving in Rosarno with no money, Ayiva resorts to theft. The men find jobs as laborers in the Mafia-controlled agriculture sector, but Abas grows violent, refusing to tolerate the pervasive wage exploitation or the indignities of life in rat-infested makeshift villages.

“Mediterranea” was well-received at the Cannes International Film Festival in May, with critics praising the way it humanized a subject that had already become a seemingly endless daily account of tragedy. “If a movie as rich and understanding as ‘Mediterranea’ suddenly appeared every time we read about a difficult issue,” Jordan Hoffman wrote in The Guardian, “maybe all of the world’s problems could be solved.”

Mr. Carpignano has been nominated for a Gotham Independent Film Award for best breakthrough director (the winner is to be announced on Nov. 30), and Mr. Seihon’s performance received a special mention last month at the Zurich Film Festival. “Mediterranea” opened the Stockholm Film Festival on Tuesday, and on Wednesday it will be screened in several European cities, including Brussels; Paris; and Seville, Spain, as part of the European Parliament’s Lux Film Prize competition.

For Mr. Carpignano, 31, the sense of urgency and the acute awareness of the racism faced by migrants in Europe were hardly new concepts. Mr. Carpignano, whose mother is African-American and whose father is Italian, grew up in New York and Rome and has long been interested in the black experience in Italy.

After studying film at Wesleyan University, Mr. Carpignano worked as a production assistant on “Miracle at St. Anna,” Spike Lee’s 2008 World War II drama. He was also an assistant director on “Beasts of the Southern Wild,” directed by Benh Zeitlin, with whom he attended Wesleyan. (Mr. Zeitlin, in turn, wrote the music for “Mediterranea,” with the composer Dan Romer.)In January 2010, riots by African immigrants in Rosarno brought Italy’s deepening racial tensions into the open. Mr. Carpignano immediately headed to Calabria to make a short film based on the riots. It “felt like the first time Italy’s African population had spoken for themselves,” he said.

But Mr. Carpignano’s attempts to connect were met with skepticism; he faced greater mistrust when he returned that summer. By then, the media circus had moved on, and many migrants felt abandoned.

Mr. Carpignano stayed in Calabria, and after several months people started opening up. Among them was Mr. Seihon, to whom Mr. Carpignano was drawn after seeing him lead a march commemorating the anniversary of the riots. Mr. Carpignano asked Mr. Seihon to star in his short film — and he refused. Eventually, Mr. Seihon accepted. “I understood he wasn’t going to show us in a bad light,” he said. They became roommates and best friends; they still live together in Gioia Tauro, a port city next to Rosarno.

That short movie, “A Chjàna,” which follows Ayiva during the riots, won the Controcampo award for best short film at the 2011 Venice Film Festival. A subsequent short, “A Ciambra,” about a Roma boy involved with the Mafia, won the Discovery Prize at Cannes Critics’ Week in 2014.Almost immediately after starting “A Chjàna,” Mr. Carpignano knew he wanted to make a feature that drew on Mr. Seihon’s life story. In 2006, after his daughter’s birth, Mr. Seihon left his family in Burkina Faso, seeking work elsewhere in Africa to support them. But Europe “was always the paradise,” he said. Two years later, he decided to try the sea journey from Libya and paid a trafficker for a place on a boat. But the captain quit shortly before the scheduled crossing. Mr. Seihon took over and, after three days of lessons with the boat’s Libyan owner, steered himself and 65 other migrants to southern Italy. In Calabria, he picked fruit; later Mr. Seihon, who speaks several African dialects, worked as an interpreter with an Italian migrant association. Today he is a migrant-rights advocate.

“Meeting Koudous, I thought, this one odyssey is grander than the riots,” Mr. Carpignano said. “I felt if he could be brought to an audience,” he added, people could “begin to move beyond the label of the ‘African immigrant’ and start seeing individuals.”

By the time he started shooting “Mediterranea” last year, Mr. Carpignano had strong ties in Rosarno. The film, which cost about 1 million euros to make, about $1.1 million, was financed by grants from the San Francisco Film Society, the Doha Film Institute and the nonprofit Cinereach, and by money from a handful of private investors and production companies.

In “Mediterranea,” only Abas’s character is played by a professional actor. Mr. Carpignano’s decision to cast Rosarno locals reflected his desire to involve “as many people who have lived this story as possible,” he said.

Today, overt antimigrant violence in Rosarno has declined, Mr. Seihon said. But if other regions in Europe have emerged as flash points, Mr. Seihon and Mr. Carpignano see little improvement in conditions for Calabria’s migrants. Mr. Seihon hopes “Mediterranea” will remind viewers that their exploitation is real, and continuing.

In one respect, though, Mr. Carpignano is somewhat optimistic about his adopted hometown. “People know Africans live here now,” he said, “that there will be black faces in Rosarno forever.”