A piece of TV history is up for grabs on Avenue M.

The loan on famed television and movie stage J.C. Studios is up for auction after the building’s owners defaulted. A source close to the deal, who declined to be identified because he wasn’t authorized to speak, said the company stopped paying on the loan about a year ago.

The $2.17-million building, which is zoned for light industry, could be attractive to developers because its zoning permits other uses. There have been at least 15 calls on the loan since it went on the market, the source said. The studio’s owners still had $17.3 million outstanding on the $20-million loan.

Once the deal is done, the owner of the loan assumes the role of the bank and can choose either to work out a payment plan with the building’s owners, or take over the building themselves. If the studio were to leave, it would be the end of an era for a neighborhood once known as a hub of the television and film industry.

Jacob Frydman, manager of J.C. Studios, declined to comment.

The studios had been struggling to find steady clients since CBS last year canceled long-running soap opera “As The World Turns,” which was filmed on the set.

“I’m not surprised,” said Sam Moskowitz, director of operations for the Midwood Development Corporation, after hearing about the loan default. “They were struggling to find a permanent tenant for their space. They’ve been filming movies once and a while, but it’s not steady.”

Representatives for Massey Knakal, the realty company auctioning the loan, declined to comment on the deal.

The studio, which takes up an entire block between Avenue M and Locust Avenue in Midwood, was best known as the stage for “The Cosby Show,” the 1960 Mary Martin version of “Peter Pan,” and several soap operas. Warner Brothers is currently filming a film adaptation of Jonathan Safran Foer’s “Extremely Loud and Incredibly Close,” but it is set to wrap this month.

The studio made headlines in April after neighbors complained that production crews hogged parking during filming, leaving few spots for their customers. They complained also in December about tractor-trailer trucks clogging the street during filming.

More from Around New York