The contest between Ambarella (AMBA -2.33%) and NVIDIA (NVDA -4.91%) isn't exactly an even one: Ambarella's revenue for its last fiscal year came in at just $310 million, while NVIDIA brought in $6.9 billion. Similarly, NVIDIA's market cap sits at $94.4 billion right now, while Ambarella's comes in at just $1.64 billion. 

Of course, those metrics may not mean much when it comes to share price gains. But NVIDIA has been winning on that front as well: Its stock price has skyrocketed more than 230% over the past 12 months, while Ambarella's has tumbled nearly 7%.  

But to really figure out which company is the best long-term play from here, we need to examine how the companies are currently performing, what potential they have in their respective markets, and what their valuations are. So let's take a quick look:  

Close-up of $100 bill.

Image source: Pexels.

How Ambarella's doing

Ambarella makes chips for image processing in devices like digital cameras, drones, self-driving cars, and body-worn cameras. For a while, Ambarella was a play on GoPro (GPRO -1.14%) because the company earned such a significant portion of its revenue selling chips for its action cameras.

But as GoPro has stumbled, Ambarella's stock has taken a hit, and the company has made a concerted effort to depend less on its largest customer. For example, Stifel Nicolaus analyst Kevin Cassidy estimates that GoPro will only account for about 5% of Ambarella's top line in fiscal 2018.

AMBA Chart

Much of the shift away from GoPro comes as Ambarella has ramped up its focus on security cameras and other opportunities.

In the recent press release announcing results for Q1 2018, which ended April 30, CEO Fermi Wang said: "Q1 revenue of $64.1 million reflects our continued push to diversify our markets and customers with strong growth in the quarter coming from IP security cameras, including both professional and home monitoring markets, and continued growth in other cameras markets including wearable and automotive cameras."

But even with this diversification, management forecasts full-year revenue will be relatively flat -- plus or minus 3% growth -- mainly due to a weakness in the drone market.

How NVIDIA is doing

Investors who keep up with the tech sector likely know that NVIDIA is on a roll right now. The company increased revenue by 48% year over year in its fiscal Q1 2018, and each of the company's key revenue segments produced double-digit percentage growth. 

NVIDIA is a dominant force in the graphics processor unit space, and holds 72.5% of the discrete desktop GPU market share right now. Beyond its strength in GPUs for PC gaming, it has become a leading player in the growing virtual reality market as well. 

If there's one thing the company does exceptionally well, it's diversification. Gaming revenues account for 53% of total revenue, but NVIDIA also uses its powerful GPUs for its Drive PX2 supercomputer, which is being used by more than 225 automakers, suppliers, startups, and research organizations as a computing platform for autonomous and semi-autonomous vehicles. The company is also a leading provider of the components at the heart of GPU-powered artificial intelligence data centers, which are quickly becoming a popular solution due to their superiority in image- and video-processing. 

NVIDIA's stock price gains have come as the company has reported stellar sequential and year-over-year growth, and applied its expertise in GPUs to an array of new markets.

Which is the better buy?

You probably saw this coming from the beginning: NVIDIA is hands down the better buy. Not only is the company consistently growing revenue in its key business segments, but it's also doing an impeccable job of expanding its reach into new markets. For example, automotive segment revenue only accounted for about 6% of the company's top line in fiscal 2017, but its potential is huge. The driverless car market is expected to be worth $77 billion by 2035, and NVIDIA's tech will have Level 4 autonomous capability by the end of this fiscal year. 

It's worth pointing out from a price-to-earnings valuation standpoint Ambarella is significantly cheaper. The company's stock trades at about 20 times its forward earnings, while NVIDIA trades at 45.

But Ambarella is still building out its place in the video-processing space after allowing its fate to stay tethered to GoPro for far too long. Though it has made some improvements in this area, the company still has a long way to go before it sees substantial growth. Meanwhile, NVIDIA is already cashing in on its dominant position and shows no signs of slowing down.