By Luke Bainbridge

When the battered body of a young Brazilian professional dancer, Douglas Rafael da Silva Pereira, was found in the Pavão-Pavãozinho favela in Rio de Janeiro, local people refused to believe the police statement – that his injuries were "compatible with a death caused by a fall". Instead, many residents of the community – which is located only a mile or so from Copacabana beach, one of the main backdrops to global coverage of the World Cup – took to the streets to express their anger. They set fire to barricades and even exchanged gunfire with the police, during which one man was killed.

Pavão-Pavãozinho was one of dozens of favelas that have been subjected to a police "pacification" programme, designed to seize back control of the areas from drug traffickers and make them safer for the tournament and the 2016 Olympics. The family of Pereira, who was known as DG, believe that the police mistook him for a drug trafficker and beat him to death.

With less than seven weeks until the World Cup kicks off in Rio de Janeiro, the latest unrest in the city last week has alarmed organisers and authorities, and only underlined the problems that they face, with the likelihood of more protests in the runup to and during the World Cup tournament and elections later this year.

With half a million foreign visitors expected to travel to Brazil and a worldwide audience of hundreds of millions, this is not the image that Brazil or Fifa wants to project before the month-long tournament.

But the battles are not just being waged on the street. Angered by what they see as a misrepresentation of the issues by traditional media, new independent media collectives and networks have emerged over the past year. Armed with smartphones, digital cameras, and apps such as Twitcasting and Twitcam that allow them to broadcast live online, they are presenting their own version of events. Some of them are reaching a huge audience across the country and are now looking to expand their reach internationally.

One such group is the Mídia Ninja, a self-styled loose collective of citizen journalists, which first emerged during last summer's protests. They are keen to present an alternative narrative to the mainstream media by reporting live from the frontline.

"Contrary to most of the reports in Brazil's mass media, the wave of protests and occupations in our country are not carried out by 'thugs' or a manipulated throng," says Felipe Altenfelder, a founding member of Mídia Ninja. "Neither do they represent a country in convulsion or moving backwards.

"This is about a crisis for democracy and more rights, and this new independent media in Brazil, streaming and circulating thousands of photos and videos in real time, has played a decisive role in making sure those protests were properly covered," Altenfelder says.

The protests in São Paulo during the Confederations Cup last June were a turning point for the newly formed Mídia Ninja, as they provided the first glimpse of the size of audience the collective could reach. They used Twitcast to broadcast, and at one point 180,000 people were watching their live stream.

"The new ways in which the protests were covered, like Twitcast, helped make them national and international news," says Altenfelder. "It captivated the country for the duration of the Confederations Cup, and put Brazil on the map of the new 'global springs'. Action that is live on the streets, and live on the internet."

Brazil has hosted the World Cup only once before, in 1950, when the biggest crowd to ever watch a football match – estimated at more than 200,000 people – crammed into the Maracanã stadium to watch the hosts play Uruguay in the final. Inexplicably, Brazil lost 2-1, a defeat which many Brazilians believe left the whole country so stunned for such a long time that the event altered the national psyche.

The late novelist and playwright Nelson Rodrigues pinpointed the day of the defeat as the source of the country's "stray-dog complex", or "the inferiority with which the Brazilian positions himself, voluntarily, in front of the rest of the world".

When it was first announced that Brazil would host this year's World Cup, back in 2007, many Brazilians saw the tournament as the moment when the country – which, according to an old saying, is the "country of the future and always will be" – finally took its place on the world stage. Public support was overwhelmingly in support of the Cup, but the mood has changed.

In 2007, Brazil was still booming. Last month a survey showed that 49% of Brazilians now thought the Cup would bring more harm than good, with just 36% believing that it would benefit the country.

"Who would have thought that in the land of football, the population would take to the streets and social networks to criticise the World Cup and the investment in the stadiums," says Rafael Vilela, a photographer and another founder member of Mídia Ninja. "But they are seeing the real cost: the poor removed from their homes, favelas occupied by a 'pacifying' police force, and other violent approaches to redevelopment of their cities which is driven by the needs of Fifa and the sponsors, rather than the needs of the people."

The costs of hosting the World Cup are staggering. The stadiums alone will cost Brazil $4bn (£2.4bn) – which works out at an eye-watering $62m per match – plus a further $7bn for associated infrastructure. At $11bn, this is the most expensive World Cup in history. Many Brazilians believe they are the ones who will ultimately foot the bill, and dismiss the notion that the tournament's legacy will mean it is money well spent. But that is not to say that Brazil has fallen out of love with football. "This is a new Brazil, where there is no contradiction between loving football and being able to criticise the World Cup," says Vilela. "You can do both."

The academic Fabio Malini, from the Federal University of Espírito Santo, studies trends and data patterns in social media and last month published a report on how social media is affecting the political climate, as well as the role it has played in recent protests.

Malini believes that "a big part of the old media saw itself humiliated by the incoming truths coming as news, streaming and first-hand accounts from the new Brazilian movement. The sum of thousands of collectives has created this 'New Big Media', that doesn't look as if it is dialectic and it doesn't depend on any mass communication system." This new network of collectives, says Malini, "already has more than 15 million users connected".

On Tuesday , President Dilma Rousseff signed a new internet civil rights bill, which has been welcomed by many activists for protecting online democracy. But the fact that the bill was signed on the same day that police and protesters clashed in the Pavão-Pavãozinho favela points to the contradictions of life in today's Brazil.

The majority of the new breed of citizen journalists are under 30, and so is their target audience.

"More than 11 million young people, between the ages of 16 and 20, will be voting for the first time in this year's elections," says Filipe Peçanha, another Mídia Ninja journalist. "These will be the first elections to take place since the emergence of Brazil's new political climate, fuelled by a new generation whose primary political reference is the popular government of former president Lula [Luiz Inácio Lula da Silva].

"These young people's mistrust of what they see as discredited traditional political parties and state institutions is shared by broad swaths of the population. They want to see real changes in the quality of public services like transport, education and health."

These young activists are aware that, with the World Cup, elections and Olympics, the eyes of the world are on Brazil and there is a huge appetite to find out more about the complex political and social situation in the country.

"The World Cup is of far more importance than football," says Peçanha. "It is a chance to create a platform for real political and cultural dialogue. We want to seize this moment of contact with a worldwide audience of activists, journalists and artists to change the topic of debate."

Mídia Ninja are working with other collectives and activists in the runup to and during the World Cup. They plan to occupy a historic area of Rio for the duration of the tournament, with space for debates and protest, as well as a multimedia centre for independent citizen journalists. "It will be like a mini-autonomous republic in the middle of Rio for the duration of the World Cup," says Altenfelder. "There will be space for collective living, cultural events, debates and a multimedia centre. We need to create new contemporary, democratic public spaces."

On Thursday afternoon, Douglas Rafael da Silva Pereira's friends and family were joined by supporters for his funeral. They gathered at the bottom of the favela and walked together to the cemetery.

"Tears of sorrow were mixed with tears of anger," says Thiago Dezan, who was responsible for live-streaming the afternoon for Mídia Ninja. "The mood was charged because the same police whom many hold responsible for his death were watching over the procession. Members of the crowd warned the police 'There will be revenge!' and at the end of the day, when we arrived back at the favela, protesters clashed with police, who used tear gas and rubber bullets to scatter the demonstration. It is just the latest example of the police trying to suppress the uprising of Brazilians."

"Just like a great game of football, Brazil today is packed with surprises waiting to happen," says Altenfelder. "We are waiting for the whistle for the kick-off, but one thing is for sure – by the end of this year, there will be a new chapter in Brazilian history, and we are determined to make sure the right narrative is told.

"We're now live and on air, and we want to speak to the world."