uPnP and AI

I have a friend that keeps some backups of physical media that they own on their network. Audio they’ve ripped from their CD collection, and TV shows and movies. They own these on physical media, but it’s an inconvenient format: Rummaging through a 24-disc set of Blu-ray discs to watch a Curb Your Enthusiasm episode isn’t conducive to viewing, for instance. Simply rebuying this in digital format from a streaming vendor would be viable if obnoxious, if it wasn’t for the fact that these venues continually keep turning that “buy” into a temporary thing, revoking access to media you bought in full. Worse, often media you rebought in full, then to have it yoinked away with no refund unless you get national media involved, and even then it’s hit or miss.

So this friend long hung a USB hard drive off of their router, as almost all routers now support media sharing. Playback devices on the network are aware of this media via uPnP broadcasts, so VLC and other clients see the source of media and allow you to navigate the folders and play your content.

This has a lot of weaknesses, from poor performance to unintuitive discovery. What if he wanted the virtual library to categorize the media into genres and by director, and by decade, and so on, to allow for easier discovery. Add that there are a lot of media management issues involved where captions need to be extracted for some clients and embedded for others, media tags need to be fixed for certain devices, and so on.

He wants something better. He has a couple of Raspberry Pi 5s sitting around not doing much, and some big magnetic discs, so surely something better can be done.

I’ve tried to help him out with a bespoke solution a number of times, but the uPnP protocol is ugly and unenjoyable to implement, and there’s just very limited time I’m willing to spend on this.

Of the solutions already existing in the space, I’ve found them either to be utter junk, to be overbearing and excessively opinionated, or to entirely be predicated around transcoding. Transcoding is a scourge, and I never want it involved in the process, and is seldom necessary. At most some compatibility processing where streams are kept unadulterated but just placed into a more appropriate container is necessary.

This need came up again, so I was curious what could be done via “vibe coding”. I wanted to spend as close to zero time on this as possible, but wanted to see what sort of solution could be built using Fable 5 with some leftover quota after doing real work.

This is the result1, and I am simply blown away at how superb the solution is. Not just for a media server that enriches all the content and provides an intuitive and flexible virtual layout of media (across audio, “TV”, and movies), enriching it with posters and descriptions and IMDB ratings, categorizing in franchise, genre, year, decade, rating, director, and so on, offering up hierarchical search at any level of any of those.

What came as a side effect turned into a primary feature: A web interface that became the primary interface for many clients, outside of Apple TV. uPnP is ostensibly served through HTTP, so why not offer up an interface for a standard web browser, and it grew from there.

And honestly…wow. My favourite feature is the detachable closed-captions window for content supporting it, with auto track-along, also usable to navigate through the content.

They also have a bifurcated network in their home so a separate announcer project allows you to configure a uPnP announcer on a separate network segment if needed. Which is necessary given the way multicast broadcast packets work.

It has a lot of configurable enrichment processes to ensure full compatibility, primarily for the web client. For instance MKV containers will be rebuilt as faststart MP4 containers for wider compatibility if there is nothing that will be detrimentally impacted doing so. And if a file has a sidecar caption file but none in the core file, it will be injected into the file for better support by uPnP clients, and if the video file has an embedded caption file but no sidecar, it will be extracted into a separate caption file to support web users. Metadata about each is automatically pulled from TMDB and correlated with the IDMB content rating file, which is periodically refreshed.

I touched zero lines of this code. I haven’t even looked at the code. But it works unbelievably well. Even with TLS on the server, running on a Raspberry pi 5, its average utilization under usage usually sits at 0%, occasionally spiking to <1% on one core. Amazing.

So while I’d like to imagine that my prompting skills are unparalleled, and my steering of Fable 5 was particularly skillful, really this project is the creation of Fable 5. I was just a bystander in awe of the state of tools now, pondering what this means for the future of software development.

And that’s scary. We are in an entirely new reality, and a lot of the industry hasn’t fully accepted this yet. A few more prompts with a little bit of extra quota can mold this into whatever media server needs one imagines.

Misogyny

I previously wrote about a police officer being pillorized by the online world. The officer is a woman so she immediately drew the volcanic anger of loads of reprehensible creeps.

I didn’t realize when I wrote that piece that she was critically wounded and ended up in a coma for a period. During her coma she was sent death threats.

In any case, my take was that not only would such a shooting be a tragic but unfortunate accident if the officer did shoot the civilian – these sorts of events happen in that sort of chaotic situation with all gender of cops – the available evidence made it likely that the officer did not shoot the civilian. That the guy who went there to kill people with malice did, in fact, kill people with malice.

I was right (that is preliminary and leaked, but you would have to be really committed to being a misogynistic piece of shit to still stick to the hateful nonsense). A lot of vile people should feel shame – if they were capable of such a thing – and need to shut their idiot mouths before running to attack someone doing something they would never have the courage to do. Deplorable behaviour. In reality, they’ll have learned nothing.

Misogyny certainly isn’t limited to men, and sometimes it reveals itself in surprising ways.

There is an ongoing case in the US of a woman, Lindsay Clancy, who admitted to strangling her three young children to death. Just an unbelievably evil act committed against helpless, innocent victims.

If you ever enjoy some brain rot and scroll Instagram Reels, you’ll quickly get inundated by women who have heroized this child murderer2, and for whom there is no scenario where she is the villain, despite the minor detail that she admitted to murdering three young children.

That she is but a woman. That her actions are all the result of external stimuli, and she doesn’t have agency or self-control, nor can she possibly engage in acts of malice, selfishness, vanity, and so on. She’s just a woman, you see. That a man is clearly the motivator and puppeteer pulling the strings for all of her actions on this planet because, again, she is but a woman.

This is incredibly common in cases like this, and the only possible explanation is a shocking degree of internalized misogyny. Like, how poorly must someone think of women to cast someone as a helpless, feckless automaton because they’re a woman? To use this to excuse their actions?

Male misogynists always find a way to blame women for everything, including for their own actions. Female misogynists always find a way to diminish women to the point where only a man can hold blame. It’s two sides of the same coin, and this situation is amazing because it has both groups up in arms.

Maybe she had a mental break and didn’t find the mental health treatment she needed, and life somehow wronged her. But the fact remains that she murdered three helpless children, and she should spend the rest of her living years either in prison, or in an institution. When males are guilty of the same act we don’t stretch reality to find justifications for their vile, often horribly selfish actions, but instead we revile them. Men have seen the chair for acts just like this.

Yes, women, as fully sentient and intelligent, self-directed beings with agency, are guilty of heinous evils too.

Culture

I’ve never intentionally littered in my life3.

Not a single wrapper, bag, or can. Nothing. I’ve never illegally dumped anything. A receipt fell out of my bag while walking to the car yesterday so I chased it down.

In those inconvenient situations where I’ve found myself with a piece of litter and no available garbage cans, I put it in my pocket or just carry it awkwardly in my hands until the opportunity presents itself to dispose of it properly. Thoughtfully. Purposefully. My own choices led to me having it, and my own actions should lead to me dealing with it properly.

I regularly pick up random litter I do find on my journeys and dispose of it properly.

This isn’t a boast, nor is it a better than thou kind of thing4, and the fact that it isn’t abnormal is precisely the point of this section. It’s something I realized the other day while contemplating cultural norms5: My Canadian upbringing, even growing up poor in a working-class, rust-belt industrial town, was that littering was a reprehensible thing to do, and that only the most thoughtless, anti-social, incompatible-with-society sorts engage in it.

This moral code is a basic value that holds when I am in the middle of nowhere, and where no one could possibly know if I did or didn’t. It is core programming.

Not all cultures share these values6, obviously. If a country looks like an open-air garbage dump everywhere you look, it’s pretty evident that these values are not the same.

It’s worth noting that the homes in these areas are often spotless, and very carefully taken care of. Residents limit their concern for their own family and their own space. The commons, on the other hand, are not at all a concern. This manifests in a corrupt, busted culture. An objectively bad culture that needs to seriously reflect on itself and improve, which history has shown is possible, having happened many times.

It is a classic tragedy of the commons. One’s circle of concern is limited to themselves and their family. It is a downfall of cooperative, civil society.

This comes up because if you take large numbers of people from a tragedy of the commons culture and put them in one where the commons are revered, problems will arise. And this is being seen in many countries right now.

Denying it, calling it racism, pretending it isn’t real, and similar “just close your eyes” retorts have dominated the discourse for years, and they’ve lost their power. Rather than trying to wave it off, groups really need to self-police their own new arrivals on this. They must demonstrate absolute best behaviours. It is reaching a boiling point, and the results will not be good for anyone.

And I’ve expressed my belief frequently that the punishment for purposeful, intentional littering should be extremely severe. Many, many thousands of dollars in fines, and if that isn’t punitive enough for the culprit, loss of freedoms. And if someone isn’t a citizen of Canada, literal deportation7. As I’ve said regarding the criminal justice system, the vast majority of migrants are model citizens, and it is massively destructive for their integration to pearl-clutch about holding the few that are a problem to consequences for their anti-Canadian behaviour.

If you cannot revere the lands and show gratitude and best behaviour for the residents of a country that took you in, you should be on the first mode of transport out of the country.

It’s so incredibly easy to simply not litter that when people are purposefully doing it, there is an intentional malice there that is undeniable.

Footnotes

  1. I put it on github as a public repo purely so my friend could automate pulling and building from it. I’m not looking for connections, stars, or any other social facet of that platform.

  2. There was a ridiculous case where an ostrich farm saw the same sort of bizarre, deranged support. These weren’t beloved animals that were cherished by their owners – the farm had a long history of half-baked, bizarre ostrich meat and pseudo-science regimes – but instead it just became a cause celeb for the mentally deranged ne’er-do-wells who have infinite time to fight their incredibly stupid culture wars.

  3. I hope that the majority of readers can identify with the norms I’m describing, and I imagine many countless millions of Canadians, and denizens of other nations, hold the same deeply embedded values. Even modern urban China has a strong moral code regarding the commons, and ensuring there isn’t a Tragedy of the Commons. It’s also plainly obvious that not all members of those sets subscribe to the values, and there are of course always the broken few: I’m not claiming these values are 100% in these groups, even if they hold for most members.

  4. Some people will knee-jerk resort to defensiveness reading that, instinctively clutching for virtuous defences against cultures being compared or judged (while simultaneously not having a moment hesitation declaring all the things wrong with Canadian culture, American culture, etc).

    Which is super weird. Cultures can be judged, and some aspects of some cultures are worse than other cultures. The whole premise of culture is that it is something we can change, and should always be open to pondering and refining.

    Cultures are norms and behaviours, and they are not above reproach.

  5. This is totally orthogonal to the rest of that piece, beyond that it relates to cultural practices: I’ve long advocated bidets on here. It’s a superior cultural practice that Japan normalized, and it has started spreading across the world.

    There is some strange retconning where those from the developing world are pretending like the Japanese prevalence of bidets is something all of Asia, the Middle East, and so on share, contrasting with those dirty whites and their toilet paper. You see this as a go to in many social media venues now, lording over those dirty-ass whites.

    Yeah, if your culture has a family “ass-wiping sponge”, or some sort of three seashell type arrangement with rocks, maybe sit this one out and save pretending like this is equivalent to a bidet. Most of us would rather return to disposable paper than to engage in that sort of “solution”.

  6. I do not have an iota of hesitation in saying this. If you are dumping a bag of waste in the river of a park, or unloading the back of your truck into some rural field, you are completely incompatible with civil society and need to be removed. This is just incomprehensibly disgusting behaviour.