Facebook (NASDAQ:FB) just reported strong second-quarter earnings yesterday. Among other things, investors were particularly encouraged by the company's outlook for expenses this year, sending shares to all-time highs in after-hours trading. Costs are now expected to come in lower than previously forecast, which will inevitably translate into more profits hitting the bottom line.

We're talking about both operating expenses and capital expenses.

Facebook data center in Lulea, Sweden

Data centers like Facebook's Lulea, Sweden, facility comprise the bulk of capital expenditures. Image source: Facebook.

$600 million saved is $600 million earned

On the earnings call, CFO Dave Wehner said that Facebook was tightening its guidance range for expenses this year. In February, Facebook said that it expected 2017 expenses to rise by 40% to 50% compared to 2016 levels, and reiterated this outlook again in May. For context, total costs in 2016 came in at $12.4 billion, doubling from 2015. The initial guidance would put total costs and expenses in 2017 at $17.4 billion to $18.6 billion.

The company is now narrowing that guidance range to 40% to 45% expense growth for 2017. That may not sound like a lot, but 5 percentage points go a long way. Specifically, that's about a $600 million reduction in the high end of guidance. That being said, Wehner said to expect head count growth to accelerate heading into the latter half of the year as the company remains "solidly in investment mode." He also said that the new guidance was largely a function of visibility, now that half the year is in the rearview mirror.

Hey, modest spender

On the capital expenditure front, Facebook did not change its guidance of $7 billion to $7.5 billion for 2017, but did say that it now expects capex to come in at the low end of that range. Capital expenditures in the first half were $2.7 billion, so spending should be back-loaded as Facebook continues to invest heavily in data centers and infrastructure. Facebook recently broke ground on two new data centers in New Mexico and Iowa.

Much of these infrastructure investments are directly related to the company's video (and video ad) strategy, which isn't a new notion, as Facebook's been discussing its bandwidth needs for years now. Here's COO Sheryl Sandberg:

Video is an important part of our mobile strategy. More video is being shared and watched on Facebook than ever before, and it's increasingly helping people and businesses connect. That's because video on Facebook is personal -- built around connections, conversations, and communities. This is why it creates opportunities for businesses to reach people in new and creative ways.

...

This means that developing short-form "snackable" content is a big opportunity on mobile. We're working hard to help marketers adopt mobile-first video ad strategies for Facebook and Instagram. In a mobile environment, native mobile video ads typically outperform more traditional ads.

Facebook is in it for the long haul when it comes to video, which is precisely why both YouTube and Snap should be worried right about now.

Evan Niu, CFA owns shares of Facebook. Evan Niu, CFA has the following options: long January 2018 $120 calls on Facebook. The Motley Fool owns shares of and recommends Facebook. The Motley Fool has a disclosure policy.