Two high court judges have said fresh proceedings can be brought against Tommy Robinson for alleged contempt of court over the filming of people involved in a criminal trial.

Robinson, real name Stephen Yaxley-Lennon, was jailed in May last year after he filmed people outside Leeds crown court and broadcast the footage on social media.

The court of appeal quashed the contempt finding in August and he was freed after serving two months of his 13-month sentence.

The case was referred back to the attorney general, who said in March that it was in the public interest to bring fresh proceedings against Robinson. The full hearing will take place on 4 and 5 July at the Old Bailey.

Robinson, 36, the far-right founder of the English Defence League, could be sent back to jail if he is again found in contempt, which carries a maximum sentence of two years. He is standing as a candidate for MEP for the north-west region in the European elections this month.

During the hearing Andrew Caldecott QC said the court should give “due weight” to the attorney general’s assessment that fresh proceedings were in the public interest.

He said the case against Robinson was being pursued on the basis that he had committed three varieties of contempt: by breaching a reporting restriction, breaching the rules covering court reporting and common law contempt.

Caldecott drew particular attention to portions of Robinson’s video in which he confronted defendants, then told viewers: “Harass him, find him, go knock on his door, follow him, see where he works.”

In another section of the video referred to in court, Robinson said: “Are you one of the six men waiting to go into court? Are you watching this? Because soon you will be live to seven thousand people in a minute, and that will be shared and shared … by the end of the day hopefully millions of people will see the faces of these alleged offenders.”

Caldecott said: “The attorney general is extremely concerned that conduct of the kind, particularly in those two passages, seen in the context of the wider video, should in any way be considered as acceptable.”

In written submissions to the court, Caldecott said that in correspondence, Robinson’s solicitors “have advanced various reasons why contempt proceedings should not be pursued”. These include the “exceptionally arduous” conditions of imprisonment he has already endured, a “medical matter”, delay, and “cost to the public purse”.

Hundreds of Robinson’s supporters gathered outside the Old Bailey in London before the hearing on Tuesday. After the court’s decision was announced, the crowd booed and chanted: “Shame on you.”

Earlier the crowd traded chants with a smaller number of antifascists organised by Stand Up to Racism, who had brought megaphones. “Refugees welcome here,” the antiracists chanted. “Refugees not welcome here,” some Robinson supporters shouted back.

Facebook Twitter Pinterest Antifascist protesters outside the Old Bailey. Photograph: Peter Summers/Getty Images

In a brief speech before heading into court, Robinson denounced the “politically motivated” prosecution. “The charge I face is that I caused anxiety to the Muslim paedophiles that have been convicted of raping young girls,” he claimed.

One of Robinson’s supporters, Kesri Johnson, said he had attended because he supported democracy and free speech. “Tommy Robinson is just a symbol of that,” he said. “Free speech is one of our founding principles and I see it as being under attack by people trying to silence Tommy Robinson.”

Johnson, who was one of the few black people in the crowd, denied that Robinson was racist. But he added: “Even if he was racist I would still be here supporting him, because I believe in free speech. Free speech is not just the free speech I want.”

Other Robinson supporters shouted abuse at antiracist protesters, calling them paedophiles.

Weyman Bennett, a co-convener of Stand Up to Racism, said: “We are here because Tommy Robinson is trying to use the platform of the elections to push racism and Islamophobia, and our job is to stop people who are racists and fascists getting the respectability that we believe will lead to more racist attacks and make racism acceptable. It’s not an accident that he chose the former leader of the BNP’s seat to stand in for election.”

The rightwing Canadian website Rebel Media, which formerly employed Robinson, had flown nine Robinson-supporting activists from as far afield as Australia and Washington DC to cover the court appearance. It is attempting to raise £20,000 in donations to cover their expenses.

One of the activists is Avi Yemini, an Israeli-Australian commentator who was recently denied entry to the US. He has described Islam as a “barbaric ideology” that has taken over England, and called Muslim countries “Islamic shitholes”.