The number of TV pilots shot in Los Angeles picked up dramatically this year, thanks to an industry-wide boom in pilot production, according to permitting agency FilmL.A.

However, the area’s market share of pilot production was its second-lowest ever, and expensive drama pilots were mostly produced elsewhere while cheaper sitcom pilots stayed here.

Some 96 broadcast and cable television pilots were filmed in the L.A. area during pilot season – a loosely-defined period running from late 2012 through the spring of 2013. Production days rose 40 percent compared with the same period last year. The agency released the numbers Tuesday.

The increase is due in part to the emergence of new outlets for original scripted content, such as streaming services from Inc. and Netflix Inc.

Despite the increase, Los Angeles still faced challenges from runaway production. A record 186 pilots were produced throughout North America during the season, meaning Los Angeles captured just 52 percent of the action. That was L.A.’s second lowest share of pilot production ever recorded.

FilmL.A. data covers the City of Los Angeles, unincorporated parts of Los Angeles County and other local jurisdictions.

The drama pilots continued their exodus to regions such as New York that offer more generous production tax incentives than California. The average drama pilot costs $5.5 million to produce. Just 22 percent of them were shot in the L.A. area.

Meanwhile, cheaper comedy pilots – which cost $2 million to produce, on average – have largely stayed in Los Angeles. Some 83 percent of comedy pilots were filmed in the L.A. area during the season.

FilmL.A. estimated that pilot production over the season generated $278 million of economic activity in the L.A. area.