Willis says of the factory farms: “They have to feed the animals laxatives because they don’t get enough exercise to defecate. The pigs get sores, the equivalent of bedsores from concrete. They get joint problems.”

My family raised pigs on the Oregon farm where I grew up. Our hogs were as smart as dogs and had personalities just as distinct. I also learned that it’s a misconception to think of pigs as filthy. On the contrary, when they have space, they are quite tidy and don’t defecate near where they sleep. They cover themselves in mud partly to avoid sunburn.

Industrial farming is justly proud of its efficiency. But to curb disease in crowded conditions, it routinely feeds antibiotics to animals, spreading antibiotic-resistant microbes that then infect humans. Confinement operations also produce vast amounts of manure that pollute water sources. So while factory farms produce cheap pork, they impose external costs such as pollution and disease that the public pays for.

While forcing hogs to be solitary and immobile in gestation crates for their entire adult lives is soul-crushing, popular disgust is leading to a revolution in industrial farming practices. Whole Foods and Chipotle and Burger King were among the first companies to avoid pigs raised in gestation crates, and, in the last few years, McDonalds, Safeway, Costco, Oscar Mayer and dozens of other companies have announced similar moves, often after a transition. It doesn’t seem as though costs will rise significantly.

Carl Icahn, the investor, warned Tyson Foods that it had to drop gestation crates if it wanted to find buyers for its pork. Tyson got the message: Just last month, it wrote to all its suppliers and told them to treat pigs more humanely and to give them space to turn around. Smithfield Foods, which is the world’s largest pork producer and was acquired last year by a Chinese company, last month reaffirmed its commitment to transition away from gestation crates.

So the tide is turning because consumers are making their preferences known. Today perhaps the larger scandal is the push by agribusiness for “ag-gag” laws that ban undercover videos like the Humane Society’s. The aim is to hide abuses of animal welfare by denying the public access to information about how livestock are raised.

“We’re deeply disassociated from so much of the animal cruelty in our society,” noted Wayne Pacelle, the president of the Humane Society of the United States. “This kind of conduct would not be tolerated if it were visible.”