Founded in 1993 by brothers Tom and David Gardner, The Motley Fool helps millions of people attain financial freedom through our website, podcasts, books, newspaper column, radio show, and premium investing services.

High-flying Advanced Micro Devices has wooed investors over the past year, while Ambarella has failed to do the same -- but that doesn't mean AMD is the better long-term buy.

Over the past year, semiconductor maker Advanced Micro Devices'(NASDAQ:AMD) stock has popped more than 296%, while chipmaker Ambarella's (NASDAQ:AMBA) has made nearly no gains.

Investors looking for a semiconductor play might look to Ambarella's beat-down stock as a turnaround play, or they might be tempted into hitching a ride with AMD in hopes of more gains. But which is really the better buy?

What's happening with AMD

AMD's stock price gains have come as the company made solid improvements to its revenue, expanded its position in the graphics processing unit (GPU) market, and looks to opportunities in new markets like virtual reality (VR).

The company has made significant gains in the GPU space and now holds about 30% of the discrete desktop GPU market share. That's important for AMD because the company's market share had slipped over the past two years from a high of 38%. Rival NVIDIA(NASDAQ:NVDA) dominates with the remaining market share, but AMD's low-cost GPUs have started taking back some ground.

It's unlikely AMD will overtake NVIDIA in the desktop GPU space, but the company does have one chip advantage over its competitor (for now). AMD is a major supplier of processors for gaming consoles, including Sony's popular PlayStation 4 lineup. Sony is a major player in the VR space as it now sells a VR headset that works with its PS4 and is working with hundreds of developers and publishers to create VR content for its console.

Sony's already sold 50 million PS4s and AMD could continue to benefit from the console maker's success if more consumers look to Sony as the virtual reality market grows. But there are also problems for AMD in the console space.

Nintendo was a longtime customer of AMD's chips for its consoles, but it recently switched to NVIDIA. That's not particularly troubling right now, but if NVIDIA's new partnership with Nintendo goes well, the other console makers might reconsider their relationship with AMD as well. That could have a potentially devastating effect as AMD brought in about 63% of its total revenue in the third quarter of 2016 from its Enterprise, Embedded, and Semi-Custom (EESC) segment -- which is mainly comprised of console chip revenue from Microsoft and Sony.

And speaking of revenues, AMD's are making some gains, but are still far below what they need to be. Third-quarter revenues were up 23% year over year and management says fourth-quarter revenues will increase 12% year over year at the midpoint of guidance. But compared to the past five years, they're still down by about 28% from their highs.

What's happening with Ambarella

There's no getting around Ambarella's tumultuous year. After a few dips and pops, the company's stock price has made next to no gains over the past 12 months. But there are a few indications that brighter days may be ahead.

The first is that the company is diversifying its video processing chip business, making it less reliant on its largest customer, GoPro(NASDAQ:GPRO). Ambarella continues to expand sales in the security camera and drone market, with the latter accounting for about 10% of its total revenue. Ambarella's systems-on-a-chip (SoC) are in a growing number of drones, including the new lineup from worldwide drone leader, DJI.

But the company is also expanding its sales in security camera technologies, with Ambarella noting that total revenues increased by 7.8% year over year in part because of "strong growth" from home security and monitoring in the fiscal third quarter.

It's certainly good to see Ambarella diversify its revenue, but the company is still closely tied to GoPro (for better, or worse). Ambarella's revenues increased "primarily due" to a spike in wearable sports cameras, led by GoPro's Hero5.

With sales of GoPro's Hero5 helping to boost Ambarella's SoC sales -- and the fact that the company is expanding further into drones and security camera markets -- the company is on the right path to benefit from GoPro but not rely entirely on the company for its future.

The verdict

Recently, I've been optimistic about AMD's future, but after some more research I'm starting to see too many cracks in the company. Sure, it has lots of potential in the GPU and VR spaces, but NVIDIA appears to be too strong of a competitor right now, and Nintendo's shift from AMD isn't a good sign for the company either. AMD's huge stock spike this year appears to be propped up by too much investor optimism and not enough strong fundamentals.

As for Ambarella, the first thing investors should expect is continued volatility for the time being. With the company still closely tied to the wearable camera market -- particularly GoPro -- any pullback on sales in that segment will bring the instability the company's experienced over the past few years. But the company could eventually be a solid long-term bet if it can continue expanding its other revenue streams. And for that reason, Ambarella looks like the better buy right now.

Chris Neiger has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Ambarella, GoPro, and Nvidia. The Motley Fool owns shares of Microsoft and has the following options: short January 2019 $12 calls on GoPro and long January 2019 $12 puts on GoPro. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.