Image caption Martin Freeman is starring as Bilbo Baggins

Filming on the two Hobbit movies has begun following months of delays caused by funding problems, a row over actors' wages and surgery for its director.

Filming is taking place at Stone Street Studios, Wellington, and on location around New Zealand.

Production on the films, starring Martin Freeman as Bilbo Baggins, is expected to take up to two years. The first is due out in late 2012.

In January, director Peter Jackson had surgery for a perforated ulcer.

Studios Warner Bros and New Line had previously considered taking the production away from New Zealand after acting unions threatened to boycott the films in protest over payments.

The unions had complained of inconsistencies in the terms and conditions of New Zealand actors and other production workers compared with their overseas colleagues.

They said they would strike if their demands for a collective contract were not met.

'Movie drought'

In an open letter written at the time, Jackson warned that shifting the entire project to eastern Europe "could so easily happen".

There are some bits of bad luck associated with it. We're all very optimistic about it. We're ready to go - just as soon as 2015 comes around Martin Freeman jokes about the problems The Hobbit has faced

"Seriously, if the Hobbit goes east - eastern Europe in fact - look forward to a long, dry big-budget movie drought in this country," he said.

After the studios threatened to leave, thousands of people took to the streets up and down New Zealand to demand that the production remained in the country.

But at the end of October, the New Zealand government passed legislation to change labour laws and improve tax breaks to ensure production remained in the country.

The changes mean actors and others working on the films will be hired as contractors not employees.

The films had earlier been stalled by problems including rows over distribution rights and the exit of original director Guillermo del Toro.

At a press conference last month, the film's star, Freeman, joked about the trials it has faced.

"There are some bits of bad luck associated with it," he said.

"We're all very optimistic about it. We're ready to go - just as soon as 2015 comes around."

The films, which also star Sir Ian McKellen as Gandalf the Grey, Andy Serkis as Gollum, Elijah Wood as Frodo and Cate Blanchett as Galadriel, are based on JR Tolkien's epic fantasy novel.

The Hobbit films act as a prequel to Jackson's trilogy of films based on Tolkien's The Lord of the Rings.