Shares of GoPro (GPRO -0.56%) and Ambarella (AMBA -1.87%) have frequently risen and fallen in tandem over the past two years. That's because GoPro, Ambarella's top customer, uses the chipmaker's image processing SoCs (system on chips) in its popular action cameras. Pacific Crest estimates that orders from GoPro could account for up to 25% of Ambarella's revenue this year.

Image source: GoPro.

GoPro surged from its IPO price of $24 to $87 in late 2014, thanks to robust sales of its Hero 4 cameras. However, concerns about market saturation, slowing camera sales, and the stock's lofty valuations knocked the stock down to just over $9 earlier this year. The stock recently rebounded on optimism regarding its new Karma drone and Hero 5 camera, but remains roughly 30% below its IPO price.

Ambarella's stock hit an all-time high of $124 last July before dropping to the mid-$30s this May. The stock also rebounded to the $70s earlier this year on rosier expectations for GoPro's new products, as well as growth opportunities in adjacent markets like drones, connected cars, and security cameras. The success of both stocks depends heavily on the upcoming holiday quarter, but will one fare better than the other? Let's discuss their growth, headwinds, and valuations to find out.

How fast are GoPro and Ambarella growing?

GoPro's sales have fallen annually for four consecutive quarters. Analysts expect another decline in the third quarter before growth finally returns in the fourth quarter on strong sales of the Hero 5 and Karma. Analysts expect GoPro's sales to rise 55% annually to $677.2 million that quarter, eclipsing the $633.9 million in Hero 4-fueled revenue in the fourth quarter of 2014.

This could be a very tough target to hit because the action camera market is much more crowded today than it was in 2014. Furthermore, there's no guarantee that GoPro can beat drone leader DJI Innovations, which recently launched the Mavic Pro, another foldable drone that is smaller and more powerful than the Karma. Even if GoPro matches analyst targets for the fourth quarter, its 2016 sales would still represent a 14% decline from 2015 -- compared to its 16% growth in 2015 and 41% growth in 2014.

Image source: GoPro.

Ambarella's revenue has declined annually for two straight quarters, but analysts expect sales to improve 5% in the third quarter and 35% in the fourth quarter. That's because Ambarella also provides chipsets for many of GoPro's rivals, like Xiaomi-backed Yi Technology. It also supplies chipsets to DJI and other leading drone makers, so its future growth isn't heavily dependent on GoPro's Karma. Moreover, demand for Ambarella's non-action camera chipsets is still expected to rise. But despite those encouraging signs, Ambarella's revenue is still expected to fall 2% this year, compared to 45% growth in fiscal 2016.

Ambarella also faces some tough headwinds. Qualcomm (QCOM -2.53%), the biggest mobile chipmaker in the world, is aggressively expanding into the action camera, drone, and connected camera markets with 4G-connected chipsets. Ambarella also reportedly faces tough pricing pressure from Chinese chipmakers in the automotive SoC segment.

Profitability and valuations

Therefore, it isn't surprising that GoPro and Ambarella's margins are under pressure. GoPro's non-GAAP gross margin fell 400 basis points annually to 42.4% last quarter. It posted a non-GAAP operating loss of $89.3 million, compared to an operating profit of $65.8 million in the prior-year quarter. Ambarella's non-GAAP gross margin rose 180 basis points annually to 67.1% last quarter, but its operating margin fell from 29.6% to 14.2% due to weaker sales weighed down by heavier spending.

GoPro expects its fourth-quarter sales to boost it back to quarterly profitability. Analysts anticipate non-GAAP earnings of $0.46 per share, which would be a huge improvement over its loss of $0.08 in the prior-year quarter. But for the full year, GoPro is still expected to report a loss of $1.07 per share, compared to its profit of $0.76 per share in 2015.

Looking ahead, Wall Street expects GoPro's annual earnings to continue falling at an average rate of 7% per year over the next five years, which gives it a five-year PEG ratio of 2.1. Since a PEG ratio under 1 is considered cheap, GoPro looks expensive relative to its earnings growth potential.

Analysts expect Ambarella's earnings to decline 13% earnings in the third quarter, followed by 27% growth in the fourth quarter on strong holiday sales of action cameras and drones. For the full year, Ambarella's earnings are still expected to fall 20% on higher expenses. On the bright side, analysts expect Ambarella's earnings to rise 16% per year over the next five years, which gives it a lower (albeit not terribly cheap) five-year PEG ratio of 1.6.

The winner: Ambarella

I personally don't like either stock due to the tough headwinds in the action camera market, but Ambarella looks like a better buy than GoPro right now. It has a more diversified business, stronger margins, and lower valuations. GoPro, on the other hand, must post record sales this holiday season. If it can't, the stock could go much lower next year.