(David Paul Morris/Bloomberg)

One of the big benefits of driverless cars is that they aim to promote safety on the roads while reducing congestion at the same time. If cars are largely run by computers, talking to each other, they can travel closer together in a more coordinated fashion without fear of causing a fender-bender.

Those machines could obviously malfunction. But on the whole, driverless cars are known to behave more cautiously than their human operators. And by virtue of their, well, virtues, autonomous vehicles won't know how to speed, run red lights, park illegally or make other traffic violations that would result in a ticket. And that could drive some city budgets into a deep hole.

Take the nation's capital, which operates the most speeding and red-light cameras of any city in the country. In 2014, the District issued an average of 773 tickets a day from its speeding cameras alone — adding up to roughly $37.5 million worth of fines, according to the latest figures from AAA Mid-Atlantic. Since 2007, speed cameras have been a cash cow for the city's police, resulting in nearly $357 million in revenue, AAA said.

Last year the city pulled in less money from parking tickets, partly due to new, smartphone-compatible parking meters that allow drivers to keep track of their status online. And driverless cars will only accelerate that trend, said John Townsend, a spokesman for AAA Mid-Atlantic.

"If you have one of these vehicles, your propensity for getting a speeding ticket or red-light camera ticket will be greatly  diminished," said Townsend. "It'll be another step in the long progression of technology and how it is changing the outcome in the number of people who get tickets."

[The data of bad driving, and how insurers plan to track your every turn]

Washington isn't the only city that reaps financial rewards from ticketing drivers. Chicago is looking at more than $1 billion alone in outstanding parking tickets, speeding tickets and red-light violations. New York drivers owe the mayor some $756 million, while the city of Los Angeles is owed $285 million, according to a Freedom of Information Act request by the local news site DNAinfo.

The scale of the problem balloons in some smaller municipalities. That's because these jurisdictions may lack other meaningful sources of revenue. The town of Mountain View, Colo., made up 53 percent of its budget with tickets in 2013. Mountain View is a bit of an outlier — tickets account for less than 4 percent of the budget in many other Colorado towns — but it's hardly unique in its approach to budgeting. In Waldo, Fla., (population 1,015) tickets written by its seven police officers are said to account for half of the town's revenue and nearly two-thirds of the police department's budget.

James Tignanelli is president of the Police Officers' Association of Michigan. He says police officers in many jurisdictions are being ordered to write tickets, sometimes despite their vocal objections.

"We're the only revenue producers in town, once you get past the  water department," said Tignanelli. "That's how it is here, anyway."

Driverless cars hold some important potential cost-savings for cities, too. Fewer accidents means cities can spend less responding to incidents. And police officers normally detailed to guide traffic or patrol for speeders could productively be deployed elsewhere. Of course, added Tignanelli, if driverless cars seriously start depriving city coffers of ticket revenue, it will likely prompt top officials to pressure police into whipping up new fees and fines.

"It'd be dog licenses, or bike licenses — there's always something," he said.

[What will happen to truck drivers when self-driving vehicles take over?]

Or it could mean a new tax. Driverless cars, with all their newfangled gadgetry, can easily log the miles they travel and report that information. Some policymakers, such as former Transportation Secretary Ray LaHood, have expressed support for a vehicle-miles traveled tax that would charge drivers a certain amount per mile. Advocates say it's a more representative way of determining a driver's responsibility for infrastructure upkeep compared to the current approach of relying on gas taxes, particularly as hybrid vehicles allow drivers to use the roads more heavily while paying the same amount in taxes as other drivers.

Implementing such a proposal is sure to be politically complex — which just underscores the potential rat's nest of a budgeting challenge that driverless cars are poised to create.