Can amateur journalism bring justice to Rio’s favelas? The favelas of Complexo do Alemão, one of the largest urban slums in Brazil, spill across 700 hilly acres in the North Zone of Rio de Janeiro, not far from the city’s international airport. Bounded on three sides by bustling highways and on the fourth by a forested ridge, Alemão can no longer grow outward, and so it has grown upward instead, in increasingly unstable conglomerations of quadruple-decker concrete boxes. “The grandfather builds the first floor, the son the second, the grandson the third and the great-grandson the fourth,” residents like to say. Rebar sprouts from the rooftops, awaiting the installation of the next story and the next generation that will occupy it.

One evening last April, Arlinda Bezerra de Assis, a 72-year-old resident of Alemão, stepped out the front door of her family home and into the neighborhood’s tangle of alleyways, her 10-year-old grandson in tow. For hours, the police had been battling with drug traffickers, but the clatter of gunfire seemed to have subsided, and de Assis, who was known in Alemão by the honorific Dona Dalva, wanted to return her grandson to his mother.

Moments later, she was found lying on her back on the pavement, bleeding from a pair of bullet wounds. She was taken to a nearby hospital, where she died of her injuries. Her grandson, shielded by her body, was unhurt.

A quarter-mile away, a 25-year-old favelado named Raull received a text message from a friend, alerting him to the shooting. (For security purposes, Raull asked that I use only his first name.) He stuffed his phone into his pocket and walked to the scene of the incident. Later, the police would label de Assis’s death an accident: She had the bad luck to wander into the midst of a firefight, a commander told a local newspaper. But as Raull made his way through the crowd, he heard a different story. The fatal shots, witnesses told him, had been fired by a police officer who mistook de Assis and her grandson for gang members. Once the officer realized his error, they said, he sprinted to his squad car and sped away.

Raull grew up on the eastern end of Alemão. As a boy, the closest thing to a local government he knew was the drug-running syndicate Comando Vermelho, which exercised near-complete control over the favelas. But in 2010, the government announced its intention to rid the favelas of organized crime. That November, more than 2,000 soldiers and police officers descended on Alemão. Comando Vermelho was driven underground, replaced on the streets by the police.

Rio’s drug gangs routinely kill civilians and police in the favelas, but at least the favelados understood the traffickers’ rules. “There were places you didn’t go and things you didn’t do,” Raull told me. “With the police, it was different. It was an occupation. There weren’t any rules. And people were dying.” According to Amnesty International, roughly 2,000 people are killed every year by the Brazilian police, often in a manner — bullet through the temple, entry wound in the back — that resembles a planned execution. Police shootings in Alemão are so common that they barely register outside the favelas. “Four or five bodies show up, six bodies, maybe it makes the news,” Raull said. “One body? Never. The media doesn’t care what happens here. They’d rather not think about it.”

In Alemão, Raull had heard stories of undercover cops executing residents suspected of having ties to drug traffickers, of heavy-caliber bullets ripping through the hollow walls of local homes and killing sleeping children. “Most of our friends from childhood are dead,” he told me. “For us in the favelas, we think, O.K., we are assured of a violent end, one way or another.” From this, Raull had derived a guiding principle for his own life: “You give back what you can, while you can.”

He spent several years trying to figure out what, exactly, he had to give back. He volunteered at an Alemão youth center and joined the local offshoot of the global Occupy movement. Then, a month before de Assis’s death, he and several friends formed a media collective they called Papo Reto, or “straight talk.” No newspaper or television reporters would set foot in Alemão, so they would take it upon themselves to report the news from their favelas. Their intention was to draw attention to the conditions in Alemão — the blackouts, the curfews, the suffocating police presence — and to warn residents to avoid particularly volatile areas. Some of Papo Reto’s members were part-time stringers for newspapers in Rio; others, like Raull, were activists armed with little more than their smartphones and tablets.

Within weeks, Papo Reto had become a kind of signal tower for the community. Members of the collective received videos and photographs of police raids and bullet-riddled vehicles from Alemão’s residents via the smartphone messaging application WhatsApp. Papo Reto disseminated the images through group chats on the same software, or on Facebook and other social media.

This simple act could have great repercussions. After de Assis’s death, Raull posted witness testimony to Instagram and Facebook, alongside photographs of onlookers congregating under the harsh glare of the streetlights and a six-second clip of the pavement still slick with de Assis’s blood. By the following afternoon, all of Alemão was ablaze. Buses were overturned and torched. Waves of enraged favelados swept through the neighborhood, demanding justice for de Assis. Television networks sent reporters to Alemão the next day, but soon, the crowds had thinned, the fires were extinguished and de Assis seemed all but forgotten. Papo Reto might have been able to stir up a riot, but justice remained out of reach. Raull took to social media to vent his frustrations. “A favela sangra!” he wrote: The favela bleeds.

Almost 5,000 miles away in New York, Raull’s posts caught the attention of Priscila Neri, a 35-year-old filmmaker and activist. Neri moved from São Paulo to Queens as a child and speaks accentless English and Portuguese. For the past six years, she has worked as a program manager at Witness, a human rights organization that helps train and support amateur journalists around the world. She had been following the Papo Reto photographers’ work since the previous month, when a member of the collective, Betinho Casas Nova, uploaded a video that appeared to show the police firing live ammunition into a crowd in Alemão. “This was the precise profile of the activists we wanted to partner with: people inside the favela, documenting their reality,” Neri told me. “But it was simultaneously pretty terrifying, because the risk they were facing was so large.” She dispatched a Witness contact in Rio to track down Raull and find out if he would be interested in working together.

Witness had an ambitious agenda. As professional-grade camera technology has grown cheaper and easier to use, and as foreign journalists have found themselves increasingly targeted in conflict zones, the work of “citizen journalists” has become a vital source of international news. (A significant share of the photographs coming out of Syria, for instance, are now shot by nonprofessionals.) But Neri and her colleagues were in the process of developing a much bolder vision of what citizen journalism could become. They believed that the footage shot by local residents in the world’s most dangerous places could be used not just to draw attention to acts of violence but also to put the responsible parties in prison. It was a novel vision for how criminal justice could evolve in the era of the smartphone, and the young members of Papo Reto seemed like the perfect partners.

Witness is headquartered in Fort Greene, Brooklyn, in an immense brick building it shares with several other nonprofits, including the Museum of Contemporary African Diasporic Art. The space is decorated with stills from films that Witness has worked on and maps from areas in which it is active: Africa, Asia and the Middle East. When they’re not in the field, the 32 Witness employees work out of a bullpen of cluttered cubicles, monitoring the arrival of new videos or talking via Skype with far-flung activists and citizen journalists. There is an editing bay, a small studio and a “museum” of old devices, like bulky camcorders and aluminum-bodied manual cameras, that serve as reminders of Witness’s origins in the pre-smartphone era.

Witness was founded in 1992 by the musician and activist Peter Gabriel, the Lawyers Committee for Human Rights and the Reebok Human Rights Foundation. (In 2001, it was spun off as an independent nonprofit.) Gabriel had long been interested in creating a nonprofit devoted to citizen video, but he was never able to stir up much interest. Then on March 3, 1991, a 31-year-old plumber named George Holliday walked onto the balcony of his Los Angeles apartment and, with his new Sony Handycam, captured footage of a group of Los Angeles Police Department officers beating an unarmed man named Rodney King.

Holliday’s tape is sometimes referred to today as the first viral video: the backdrop to a week of the worst rioting Americans had seen in a generation. Two L.A.P.D. officers were convicted of violating King’s civil rights, and a jury awarded King $3.8 million in a civil suit against the city, based largely on Holliday’s video. For lawyers and activists, the judgment was proof that the way certain criminal acts were documented was about to change drastically.

In its early years, Witness mostly worked to distribute video equipment abroad and to teach people how to use it. Local partners documented sex trafficking in Eastern Europe, forced government evictions in Cambodia and violence against women in Zimbabwe. By 2010, however, the camcorders that had made citizen journalism possible in the first place had given way to a second and more sweeping advancement: the near omnipresence of the cellphone camera.

Camcorders were useful, but they were also expensive, finicky and conspicuous. Cellphones, on the other hand, were cheap, durable and easily concealed. What a cellphone camera lacked in fidelity, it made up for in ease of use and ubiquity. Activists no longer had to run home to grab their video cameras; they had them in their pockets already. And distributing the videos to a global audience, thanks to the explosion of social media, was a matter of a few clicks.

Cellphone imagery was vital in sustaining the Green Movement protests in Iran in 2009: The shooting of Neda Agha-Soltan, the Iranian woman who was killed by state security forces in what was declared “probably the most widely witnessed death in human history” by Time, was one of the first images of such global impact to be captured on a phone. During the Arab Spring demonstrations in 2010 and 2011, protesters took their phones with them everywhere they went, documenting their struggles in shaky footage that felt far more visceral than anything professional news crews were capturing.

But when Witness surveyed human rights lawyers and protesters, they encountered a recurring set of frustrations. Activists worried that amid the deluge of amateur videos, the most important clips were sometimes being ignored. And what was the point of risking your life to gather direct and inconvertible evidence of wrongdoing if the perpetrators were allowed to walk free?

Kelly Matheson, the lead of Witness’s Video as Evidence program, has thought a great deal about that question. Matheson, who grew up in Iowa, has the singsong cheer of a native Midwesterner and an unflappable optimism uncommon among longtime human rights workers; you can hear the exclamation marks in her voice. “My roots are in Iowa, but my feet are all over the world,” she is fond of saying.

Originally trained as a lawyer, Matheson left her practice in environmental law in 2003 to pursue an M.F.A. in documentary filmmaking. When Witness started the Video as Evidence program two years ago, she began scouring the legal record for precedents, of which there were a handful. In 2013, Larry Krasner, a lawyer in Philadelphia, defended a man named Askia Sabur, who was charged with assaulting a police officer. Krasner located a cellphone clip, shot by an eyewitness, showing that Sabur was the one who had been assaulted. The judge admitted the video as evidence, and Sabur was exonerated.

There was an international precedent as well. A decade earlier, Witness partnered with a nonprofit in the Democratic Republic of Congo, Ajedi-Ka, to assemble footage of interviews with child soldiers who had been recruited by a local militia. The footage was presented to the International Criminal Court, which later convicted the militia leader Thomas Lubanga of war crimes and crimes against humanity. “We were unable to dispute the visual images or deny the sound,” a presiding judge at the court later said. Matheson told me that the Lubanga case proved that video could be used to “fill an evidentiary gap.”

But cases like those were rare. Too often, witnesses’ videos were shaky to the point of ambiguity or lacking in metadata that would have helped confirm their veracity. In 2012, four police officers in São Paulo were charged with murdering a 25-year-old suspected car thief. A bystander used a cellphone to film one of the officers. But defense lawyers argued that that gunshot was actually an accidental misfire and that the victim had sustained his other wounds in a previous firefight. All four officers were acquitted.

And the instincts of camera-wielding activists were often a liability. Citizen journalists “do incredible work,” Peter Bouckaert, Human Rights Watch’s emergencies director, told me, “but often with a political agenda, and we need to make sure we filter that out.” Two years ago, I traveled to Reyhanli, a Turkish city on the western border of Syria, to interview rebel-aligned Syrian activists, who showed me photographs and videos supposedly depicting atrocities committed by Bashar al-Assad’s government or on its behalf. One clip, of two men being decapitated with a chain saw, had clearly been repurposed. It turned out to be an old Mexican drug-cartel video dubbed in Arabic.

Even scrupulous activists typically shoot for maximum emotional impact; their intention is to incite outrage from their audiences. Evidentiary work requires a more detached eye. “It’s instinctual to shoot that puddle of blood or the body lying on the ground,” Matheson told me. “It’s not instinctual to turn around and get a badge number or the location of a communications tower. If you’re strictly a media activist, you’re not going to show the world a communications tower. It’s not going to make the news. It’s not going to mobilize anyone. But from a legal sense, you need those details.”

Matheson set about drafting a set of standardized guidelines that could be used in training seminars or handed out in index-card form to activists in the field. Tight shots are important, she wrote, but 360-degree panning shots are also necessary: You want to document as much of your surroundings as possible. Find geographic landmarks that can’t be faked, she suggested: mountains, familiar buildings, street signs, clock towers. Make sure the date, time and GPS data on your camera or phone are accurate. Say that information aloud, at the beginning of the video, in case the metadata becomes corrupted. If you’re filming anonymously or surreptitiously, write the location and time on a piece of paper, and hold it directly in front of the lens for at least 10 seconds. And as soon as you return home, it’s ideal to upload the clip to an encrypted storage service in the cloud.

Matheson stressed the importance of so-called linkage evidence — license-plate numbers, military-uniform patterns, close-ups of official documentation — that could be used to place individual perpetrators in a chain of command. Without linkage evidence, you had an individual actor: a rogue cop or soldier who might as well be acting in a vacuum. With it, you had the power to hold responsible an entire police unit or army battalion.

Witness’s first Video as Evidence trainings, in late 2013, took place in the Middle East and were aimed at documenting the war crimes and government crackdowns that had spiraled outward from the Arab Spring. A year later, the organization decided to expand the program to Brazil, focusing on the country’s epidemic of police violence.

As a test case, Brazil had a great deal to recommend it. Brazilians have a fraught relationship with their national police force, one that dates back to the military dictatorship that ruled the country until the 1980s. In some corners of Brazilian society, the police are revered. “Tropa da Elite,” or “Elite Squad,” a 2007 film that chronicles the exploits of a police anti-gang task force, is among the most popular films in South American history. In others, they are regarded with fear and distrust. The vast majority of the thousands of people killed by the police in Brazil every year are young and black, and officer convictions are practically unheard-of.

But unlike, say, Syria, Brazil is a functioning democracy, with a legal system in which cases could theoretically be brought to trial. If Witness wanted to establish a beachhead for successfully prosecuting human rights abuses with video evidence, the place to do it was Rio de Janeiro.

One afternoon in January, I accompanied Victor Ribeiro, the 33-year-old videographer who serves as Witness’s point man in Brazil, and a local media activist named Patrick Granja, whom I hired as a fixer, to a demonstration against a nationwide increase in public bus fare, the second fare hike in two years. After the first, in 2013, hundreds of thousands of young Brazilians took to the streets in several cities in protest. As the demonstrations spread, they came to encompass a wide range of grievances: government corruption, the skyrocketing cost of hosting the 2014 World Cup and the growing sense that ordinary Brazilians would benefit little from the tournament.

The police, unaccustomed to dealing with such large crowds, responded with what was widely seen as disproportionate force, and at least one protester was killed. Ribeiro was arrested and spent 10 nights in prison on charges of setting a police kiosk on fire; he was exonerated, he said, after producing a video showing he never went near the location in question.

Ribeiro predicted that at some point the police would turn on the crowd. They wanted to be on hand when it happened. “Tonight, this protest will be on the news, but I doubt any of the big television stations will show the police doing anything wrong,” Ribeiro said. That was what his camera was for.

We were standing in a square in downtown Rio, in front of the stately City Hall, a thousand or so protesters milling around us, balaclava-clad anarchists alongside college students in faded denim and neon tank tops. “They won’t last once the tear gas starts,” Granja predicted of the students. He had brought along a flak jacket, a gas mask and a bicycle helmet.

The plan was to march from the square in front of the City Hall to the main train station, Central do Brasil, and back again, a round-trip of several miles. Helicopters, belonging to the police and to local news networks, hovered overhead. More protesters arrived, and so did more police officers, some of them in riot gear, wearing armor and carrying shotguns and assault rifles.

As the sun dropped behind the mountains, I watched the first demonstrators make their way through the entrance of the train terminal. Inside the concourse, the police were waiting. Protesters hurled glass bottles against the wall. Out on the main boulevard, a man wrapped his fist in a Brazilian flag and punched out the window of a passing car, then disappeared under a police baton.

I felt a hand tugging me backward; it was Ribeiro. A tear-gas canister dropped onto the pavement where I had been standing. A cop slammed a kid in a Malcolm X T-shirt against a wall. Business owners were locking their doors and pulling heavy metal grates down over their windows.

Closer to City Hall, where the march began, the street narrowed. Someone lit a pile of trash on fire. An anarchist lobbed a long fluorescent light bulb, which shattered against the awning of a nearby restaurant. The police surged forward. There was enough tear gas and pepper spray in the air that it was hard to breathe. I watched Ribeiro duck into an alleyway, camera held aloft.

A riot-police officer had a girl in a chokehold, her feet aloft and kicking, her face a mask of panic; she couldn’t have been older than 18. As he hauled her away from the crowd, he lost his balance and toppled backward, the girl falling on top of him. Protesters pressed in, and the police pushed them back. Ribeiro nosed his lens into the scrum. One officer, hidden behind a plastic riot helmet, leveled his shotgun at the chest of a demonstrator. “Run!” someone yelled as stun grenades scattered around us. Granja grimaced; I saw that he had blood on his thigh.

We regrouped 20 minutes later at a restaurant on the square. Ribeiro’s camera lens had been broken by the police, but the memory card seemed to be intact. Granja had been hit with shrapnel from a grenade. Ribeiro asked if we could call it a day; it was getting late, and he wanted to have the video up online first thing the next morning.

These street clashes, occurring in well-trafficked public spaces and involving relatively affluent and media-savvy young protesters, were easy enough for Witness to document. Harder by several orders of magnitude was gathering video evidence of the violence in the favelas. There, the police operate with near impunity, outsiders are unwelcome and the very act of holding up a smartphone makes you a target. “It’s very difficult for a nonresident to march into a favela and start taking pictures,” Ribeiro told me. “Impossible, basically.” That was what made a group like Papo Reto so valuable.

The negotiations between Witness and the collective had been delicate and slow-moving. “In the favelas, there’s a general distrust of NGOs,” Priscila Neri told me, “because so often you have a group swoop in and take the credit and dash back out again.” Finally, late last year, Ribeiro arranged a sit-down at the community center in Complexo do Alemão. Neri and Matheson were on hand, along with Ribeiro and four members of Papo Reto. For almost two hours, Witness representatives asked the collective members about the digital platforms they used, their security precautions and the kinds of equipment they had. Of chief concern to Neri and Matheson was the safe storage of data. Much of the material Papo Reto collected was not being encrypted or archived at all, only posted to Facebook and WhatsApp, where it could accidentally be deleted or otherwise lost.

And although the group had excelled at collecting videos from the aftermath of shootings, it had done little to organize them. “One of our first suggestions was to create a database,” Neri told me, “to see the bigger patterns of police violence. Right now, you have a lot of stars in the sky, but you want a constellation.”

A month after the initial meeting, I was invited by Ribeiro to attend a video-as-evidence training session with Papo Reto. But hours before we were due in Alemão, the plan was scrapped. A high-ranking member of Comando Vermelho had been killed in a shootout in another favela, and the syndicate had declared a mandatory two days of mourning, during which no outsiders came and went from Alemão.

We tried again two days later. Granja drove. His car, a subcompact Chevy with battered doors and a drooping exhaust pipe, careened across the outskirts of Rio proper, past acres of parched, furrowed earth, which were the only visible remains of a favela that had been torn down by the government in preparation for last year’s World Cup. The glow of the city center receded behind us.

We arrived in Alemão around 10. Down by Rio’s beaches, there had been a breeze, but as we ventured farther inland, the air grew turgid and thick; even standing still it was impossible not to break a sweat. Overhead, gondolas shuddered by in a perpetual loop — ghost trams with no one inside. The city government had built five stations in the favelas several years before, in hopes of attracting tourists. But the recurring violence has kept visitors away, and the neighborhood residents preferred to use cheaper motorbike taxis.

Granja parked his car, and we made our way up a short slope. The police were out in force, as they always are in Alemão, their semiautomatic rifles in firing position, aimed at the passing foot traffic. We found a cafe and sat on plastic stools around a banquet-style table. I recognized the area from a Papo Reto clip showing a line of police officers firing their weapons into a crowd of favelados.

A few minutes later, Lana and Raull showed up. They were clutching their electronic devices — a tablet for Lana, a tablet and a smartphone for Raull — in front of them, as if they might offer some protection. It had been, Raull said, “a bad few days.” The police had stopped a member of Papo Reto and ripped up his press card. Another had come home to find his apartment turned upside down.

Raull is stocky and heavy through the shoulders, with lacquered black hair, an immaculately maintained goatee and a practiced bombast that makes him appear much taller than he actually is. He has the Hawaiian word “aloha” tattooed on his neck and “acreditar,” or believe, on the inside of his right forearm. He was wearing a flat-brimmed baseball cap with a marijuana leaf emblazoned prominently on the crown. (“More gangster rapper than reporter” is how one of his friends describes him.)

I asked Raull if he ever worried that he was too exposed. After all, he used his real name on Instagram and Facebook and often uploaded videos from other faveladosto his account, in order to protect the security of the members of his network. He shook his head. “Exposure, being public, is its own kind of security,” he said. Still, he said, what he was most eager to learn from Witness was “proper security protocols.” At demonstrations, the police often pointed their weapons at him first. He could not help feeling that he had become a marked man.

Other human rights activists I spoke to worried that citizen journalists like Raull might not even be aware of all the risks they were running. “If the work is intercepted,” Bouckaert told me, “there’s a great danger of people being picked up, jailed, killed. And I do think human rights groups sometimes underestimate the sophistication of the surveillance tools available to governments in some of these areas.” He recalled visiting the office of Abdullah al-Senussi, Libya’s feared intelligence chief, shortly after the overthrow of the Qaddafi government and marveling at the equipment on hand and the extensive dossiers on activists, replete with social-media records and email data.

Several groups have tried to solve the surveillance problem from a technological perspective. Bouckaert is developing a digital-video-preservation vault. Two engineers from the Medical College of Wisconsin, Brian Laning and Bonnie Freudinger, recently won a United States Agency for International Development grant to work on the International Evidence Locker, a free smartphone app. Photos collected on the app are automatically location-, date- and time-stamped, encrypted and securely sent to two separate protected servers, Freudinger told me. They can also be submitted anonymously. Witness is developing its own software, too.

With Witness’s guidance, Raull and his associates had started taking more precautions in their own work. They stopped posting videos in which it was obvious where the video was shot from — from which the police might be able to identify the residence of the shooter, for instance. They had started working in groups. The next step would be to learn how to encrypt files.

The training would be time consuming, Raull said, but worthwhile. “Because the effect multiplies,” he said. “As more people learn about what we’re doing, they’ll send us videos, and we’ll be able to show more of the truth.” He mentioned a plan that he was discussing with Ribeiro to reach out to the young men who drove motorbike taxis in Alemão. The drivers covered large swaths of the favelas every day, and all of them carried smartphones.

Lana said that her mother thought she was “crazy” for associating with Papo Reto, but she told her mother she was proud of what she was doing. “More and more videos appear every day,” she said. “It’s a process. But it’s something good, and the more evidence we can produce, the more we can show the outside world what’s happening here, the better it can get. You can dream.”

It’s not a crazy dream. Last year, a 38-year-old favelado named Cláudia da Silva Ferreira was shot in the neck and torso in Rio’s Complexo da Congonhas favelasduring a shootout between the military police and gangs and loaded, unconscious, into the trunk of a patrol car. On the road, the trunk opened and Ferreira’s body tumbled out; she was dragged about 1,000 feet and was pronounced dead shortly after that at a hospital. Another driver filmed the incident with a cellphone camera and sent the video to the local newspaper Extra. Government officials were forced to denounce the actions of the police, and the three officers involved were arrested. They are now awaiting trial.

The International Criminal Court, meanwhile, is conducting investigations in several regions where citizen-produced video evidence could be crucial. In Nigeria, prosecutors are looking into allegations that the militant group Boko Haram has committed crimes against humanity. Already, hours of cellphone footage of the group’s movements have been uploaded to YouTube. And in July, the court upheld a decision to have al-Senussi tried in Libya on charges of murder for his role in putting down the anti-Qaddafi protests. Bouckaert told me that activist footage of the protests would likely be entered as evidence by the prosecution. Similarly, if Assad is ever toppled in Syria and brought to trial, the court will have hundreds of hours of tape to work with.

Two weeks after I returned to the United States, I received an email from Ribeiro. The police and traffickers were again fighting in the alleys of Complexo do Alemão, and the residents of the favelas were spending much of their time indoors. On Facebook, I looked at the most recent work that Papo Reto had posted. In their videos, tracers streaked through the night sky, and platoons of armored police officers marched through the streets. A final photograph showed a boy lying in a hospital bed. Bandages covered his torso; the caption explained that he had been caught in the crossfire, taken a bullet, but survived. “[He] is recovering,” the post read. “Everything will work out!”

Correction: March 8, 2015

A picture caption on Feb. 22 with an article about amateur journalism in the favelas of Rio de Janeiro misstated the name of the area where the police were shown on patrol. The photograph was taken in Vila Cruzeiro, not Vila Aliança.