During his 17-day stay in jail, 32-year-old David Stojcevski lost 50 pounds, hallucinated, and experienced seizures and convulsions. It was all caught on a security camera that jailers were supposed to regularly watch. But no one helped — and Stojcevski died.

Now, the FBI is investigating the death, according to Detroit News.

The horrifying death of Stojcevski in the Macomb County, Michigan, jail — first reported by Local 4 — is drawing national attention as the latest example of horrific neglect and brutality by the criminal justice system. And unlike previous cases, it was all caught on video — making it easy to see exactly what went wrong.

But beyond the gruesome images and FBI investigation, Stojcevski's death speaks to a much larger problem in the criminal justice system: In many cases, jails aren't staffed, trained, or resourced to deal with cases like Stojcevski's. But they continue locking up excessive numbers of people, even when it might not be necessary.

Stojcevski clearly suffered over 17 days — and died

Macomb County sheriffs picked up Stojcevski in 2014 after he failed to pay a $772 traffic ticket for careless driving. Stojcevski was placed in a jail cell and later a mental health cell, even though a nurse who evaluated Stojcevski suggested putting him in a drug detox unit.

He was supposed to serve 30 days in jail for not paying the ticket. But he would be held there, naked (inmates don't wear clothes in the mental health unit, apparently for their own protection), until his death, 17 days after he was locked up.

Prior to his jail stint, Stojcevski was being treated for his drug addiction with methadone, Xanax, and Klonopin to stave off withdrawal symptoms, which can be deadly. Even a basic knowledge of these drugs and addiction suggests that suddenly yanking Stojcevski off of his medication would cause withdrawal — and that's exactly what happened when jail officials didn't give him the drugs.

Over 17 days, Stojcevski displayed typical withdrawal symptoms. He didn't eat, likely due to withdrawal-induced nausea. He shook and appeared to experience seizures. He seemed to hallucinate, reenacting a previous fight with an inmate. On his last two days, he laid on the floor, shaking and in clear distress.

During all this time, staffers rarely tended to Stojcevski's needs, even though his cell was under surveillance 24 hours a day. As he lay on the floor shaking and not eating his food over 48 hours, no one showed up to help until the very end. But it was too late — he was pronounced dead at the hospital.

In response, Stojcevski's family filed a federal lawsuit over his death. A lawyer for the county told Local 4 that the lawsuit "lacks legal merit," and the county reportedly has no plans to settle, because it expects the family to lose if the case goes to trial.

Jails are notoriously overcrowded

Stojcevski's death is an extreme case of neglect and abuse in a US jail. But it also represents a much broader problem in US jails: Very often, jails don't have the staff to deal with all the inmates they receive.

The Macomb County jail is very familiar with overcrowding. In June, the sheriff declared a state of emergency because the jail was overcrowded, according to the Detroit Free Press. And that was the 15th declared overcrowding emergency since 2003.

To deal with overcrowding, the sheriff typically declares an emergency and releases some inmates, excluding those accused or convicted of violent crimes, sex offenses, breaking and entering, drug dealing, or any other major felony. Stojcevski, in jail for an obstruction of justice charge stemming from a minor traffic violation, would likely fit the type of inmate who's released during these declared emergencies.

By definition, an overcrowded jail doesn't have the staff to handle all the problems that arise in these facilities. In Stojcevski's case, it's possible that staffers didn't respond to his clear medical crisis because no one was available, either to watch the 32-year-old or to care for him.

Should Stojcevski have been jailed at all?

For criminal justice reformers, this type of overcrowding has raised questions about whether so many people should be jailed in the first place. In a New York Times story about jail reform, Peter Goldberg, executive director of the Brooklyn Community Bail Fund, told the Times:

We can't be satisfied with cosmetic fixes. And the truth is, even meaningful bail reform is just the beginning. The real work is asking why we're arresting so many people on low-level offenses in the first place, and why so many of them come from poor black and brown communities.

In Stojcevski's case, the question is whether he should have remained jailed for not being able to afford a rather high traffic fine. If the Macomb County jail can release low-level offenders when it's over capacity, why can't it do so on a more regular basis, or avoid locking up these types of offenders altogether? There are, after all, many alternatives to incarceration, such as payment plans for fines, probation, home arrest, and community service.

Incarcerating someone who can't pay a fine is also tantamount to debtors' prisons, which lock people up for failing to pay a debt. Not only are debtors' prisons unconstitutional, but they're also unfair to poor people and impose extraordinary harms, the American Civil Liberties Union explained:

They lead to coercive debt collection, forcing poor people to forgo the basic necessities of life in order to avoid arrest and jailing. Debtors' prisons waste taxpayer money and resources by jailing people who may never be able to pay their debts. This imposes direct costs on the government and further destabilizes the lives of poor people struggling to pay their debts and leave the criminal justice system behind. And, most troubling, debtors' prisons create a racially skewed, two-tiered system of justice in which the poor receive harsher, longer punishments for committing the same crimes as the rich, simply because they are poor.

Jails often aren't equipped to deal with mental health problems

There are also signs that jail staff simply didn't know how to treat an inmate with medical needs like Stojcevski. As two mental health experts told Local 4, Stojcevski was clearly suffering from a medical condition even as jailers did nothing to care for him.

Complaints about inadequate mental health care in jails are nothing new. According to a review of the research by the Urban Institute published in April, only one in six jail inmates receive mental health care following their admission, even though nearly two-thirds of jail inmates report mental health problems. And those who do receive care often get inadequate or shoddy treatments that aren't evidence-based.

One sign the jail was unprepared for a case like Stojcevski's: Staff obviously misdiagnosed him. Jailers put him in the mental health ward for mental instability and erratic behavior. But the staff knew Stojcevski was taking drug addiction medication, and he was obviously suffering from withdrawal. As Donna Rockwell, a clinical psychologist, put it to Local 4, "anybody who even has two minutes of training would know that." That jail staff apparently saw Stojcevski's symptoms and did nothing suggests they lacked adequate training or acted negligently.

This wouldn't be the first allegation of improper treatment against the Macomb County jail. According to Michigan Radio, six inmates in the mental health section of the jail in August filed a handwritten federal lawsuit alleging that "conditions within the jail, and within the mental health ward in particular, [fail] to ensure the protection of inmates civil and/or constitutional rights."

So even if there were available staff monitoring Stojcevski, it's possible that they just didn't have the proper training, resources, or knowledge to treat him.

Macomb County officials, however, insist they followed "proper procedure" in the case. But if that's really true, maybe the problem is the procedure is inadequate in the first place — and something is wrong with how the county jail deals with people in clear need of medical help.

Watch: Why it's so important to film the police