A coastal management expert has warned against frolicking in the large swathes of foam which are blanketing Australia's eastern beaches.

Many are flocking to the coast to witness the natural phenomenon, stirred up by ex-Tropical Cyclone Oswald's ferocious winds and torrential rain.

But Professor Rodger Tomlinson from Griffith University's centre for coastal management says the foam may contain sewage and toxins.

"During events such as this we get a lot of stormwater coming onto our beaches which gets mixed up with the ocean water and that material can be trapped in the foam," he told 612 Brisbane.

"So there may be some issues there of concern because of that."

But he says the most dangerous aspect of the foam is what lies beneath.

Loading...

A video from the Sunshine Coast has gone viral after it captured two police officers nearly being struck by a car as it emerged from a deep layer of foam.

"The real problem with beach foam is that you don't know what's underneath it and I think that video image of the car appearing out of nowhere is a classic example," Professor Tomlinson said.

"You don't know whether there are rocks under there, broken glass... so I think there's a real concern about safety.

"I certainly think you shouldn't be playing in it."

Professor Tomlinson says the unusual amount of foam is caused by the ocean being stirred up and strong winds driving the matter onshore.

He says it should dissipate naturally once the storm is over.

"The bubbles will burst. It's a bit like milkshake - if you stir it up and let it sit still, it'll eventually all settle down," he said.