The film, about the rise of rap group N.W.A., which earned more than $161 million in U.S. theaters, outsold by a 2-to-1 margin the No. 2 title, 20th Century Fox’s “The Martian,” which dropped a spot on both sales charts after debuting on top a week earlier.

Two newcomers rounded out the top five. Warner’s “The Intern,” a comedy with Oscar winners Anne Hathaway and Robert De Niro, debuted at No. 4, followed by Universal Pictures’ “Everest,” a thriller inspired by an ill-fated attempt to climb Mt. Everest in 1996, at No. 5. The pair were flipped on the Blu-ray Disc sales chart, with “Everest” at No. 4 and “The Intern” at No. 5.

The only other newcomer in the top 10 was the faith-based title “Woodlawn,” produced by Pure Flix and distributed by Universal Pictures, which debuted at No. 6.

Blu-ray Disc accounted for 59% of total unit sales of “Straight Outta Compton,” the highest percentage among the top titles for which both formats were available. “The Martian” in its second week saw 57% of its unit sales come in the high-definition format. Among the other newcomers, Blu-ray accounted for 30% of “The Intern,” 54% of “Everest” and 32% of “Woodlawn.”

On Home Media Magazine’s rental chart, the top three titles were unchanged from the previous week: “Hotel Transylvania 2” at No. 1, Universal Pictures’ “Ted 2” at No. 2 and 20th Century Fox’s “Maze Runner: The Scorch Trials” at No. 3.

Switching spots from a week earlier, Lionsgate’s “Sicario” came in at No. 4 and 20th Century Fox’s “Fantastic Four” remake took No. 5.

The new titles from Universal Pictures and Warner are subject to a 28-day delay at Redbox rental kiosks.