LOS ANGELES — After years of on-and-off flirtations, Comcast is in talks to buy DreamWorks Animation, the boutique studio run by Jeffrey Katzenberg that has struggled to move past the boom-and-bust cycle driven by its sporadic film releases.

The possible deal would value DreamWorks Animation at roughly $3 billion, or about 30 percent more than its current market value, according to two people with knowledge of the talks, who spoke on the condition of anonymity because they were not authorized to discuss them. The negotiations were first reported by The Wall Street Journal.

If a deal goes through — still an if, especially given DreamWorks Animation’s checkered history with potential sales and mergers — Comcast would combine the company with its own animation division, Illumination Entertainment, according to these people.

Christopher Meledandri, the chief executive of Illumination, which has found success in low-cost smash hits like “Despicable Me,” would most likely run the operation.