-
Adventures in multi-lingual subtitles
8 hours ago • 0 commentsI'm an (American) English speaker, but I watch quite a bit of non-English movies and TV. Although I can ask for the location of the library or train station in multiple languages, I can only catch the occasional French or German word when watching TV.
I need the English-language subtitles. Quite often, they are included with the program material. In that case, they're usually the best choice. (I fully understand why they might not match a literal translation of the spoken dialog or even the foreign language subtitles, which might also not match a literal translation of the spoken dialog. And they also often don't match the spoken dubbed English; I don't like watching dubbed content.)
(I happen to know the difference between subtitles, closed captions, open captions, and subtitles for the deaf and hard of hearing. For the sake of simplifying the discussion, especially for readers who don't know the difference and don't care, I'm referring to them all as subtitles in this document even though most of them are not technically subtitles at all.)
If I can get a subtitle file in the original language of the show, there are numerous websites (for example) that can translate them to English for me. Although this translation does avoid a subset of the mismatches mentioned above, it has minor glitching of its own. For example, it often makes mistakes in pronouns when translating gendered languages, and sometimes a word with multiple meanings in the original language will be translated into the wrong choice in English. I can live with this small amount of noise.
I recently became interested in a TV series called The Danish Woman, aka Danska konan (not to be confused with the unrelated 2015 movie The Danish Girl). It's a French and Icelandic co-production. It takes place in Iceland. The spoken dialog in that series is Icelandic, Danish, and English. So far, I have not seen any French dialog. Getting a good set of subtitles in English so I can watch it without losing too much is quite challenging for this particular series because of the mixture of spoken languages and the video production treatment of them.
The rest of this essay is a description of how I worked through it to get "good enough" English subtitles.
Before I found out it was a French/Icelandic co-production, I assumed the best version would be what they show in Denmark. I obtained a copy of that, and boy was that incredibly wrong. It did have Danish subtitles, and I got a passable English translation of those. The audio track was the problem. When Danish was spoken, things were as you would expect. When Icelandic or English was spoken, the dialog was dubbed, but it was dubbed in a way I had never experienced before. The same dubbing voice was used for all characters, and the volume level of the dubbing was much louder than the non-dubbed Danish dialog. It was really distracting to try to watch that. I don't know if that's normal for Danish foreign-language content or if this is some weird one-off.
I went in search of something better. It was at that point that I learned that it was a French/Icelandic co-production, so I obtained the French and Icelandic versions of the series.
The French version's French subtitles gave a complete and usable English translation, but I didn't find that out until after I had spent quite a bit of time working through obstacles with Icelandic version.
In the Icelandic version, for reasons I don't fully understand, selected bits of Icelandic dialog were burned into the video itself. In other words, they were not subtitle tracks or closed caption tracks that could be turned on or off. They were always present on the screen. That's distracting, but even worse was that the Icelandic subtitles did not include those burned-in bits, so they were not included in the files I sent through translation to English. I used ccextractor to read those burned-in subtitles. It took a couple of minutes to process a 1.4gb file and worked...
Read more » -
Smart Home: HVAC status with fan and heat pump
03/13/2025 at 01:01 • 0 commentsFor a couple of years, I've had a heat pump, and I also have a gas furnace that kicks in when it's too cold for the heat pump to be efficient. That's a common arrangement and is referred to as "aux heat" in the HVAC argot. Because of some recent shenanigans with the heat pump, I've become more interested in when the heat pump is in use versus the aux heat. For unrelated reasons, I'm also interested in when the HVAC fan is running, whether as part of heating or cooling or by itself. My thermostat lets me configure a minimum number of minutes per hour to operate the fan (to even out temperature swings).
I monitor and control my smart home stuff with Home Assistant. It gives me most of what I want with standard capabilities, but it doesn't give me everything. This is a description of how I have set things up. I use it only for monitoring since the thermostat is more convenient for taking actions compare to Home Assistant UI widgets.
Home Assistant understands climate control devices and provides a couple of UI cards to display them.
The top half is a thermostat card, and the bottom half is history-graph card that knows how to deal with a climate device. Both cards show, in different ways, when the heat is on, but without differentiating whether or not it's the heat pump. The thermostat card will indicate "Fan" if the fan is running without heating or cooling being active.
In addition to those standard cards, my smart home dashboard (on a tablet as a touchscreen) includes a series of buttons. One of those buttons shows what's currently going on with my HVAC:
Default (and fan-only):
![]()
Cooling (heat pump):
![]()
Heating (heat pump):
![]()
Heating (furnace):
![]()
It's implemented via a custom button-card, a component with about a zillion features. One of those features is to conditionally have the icon spinning, which I do when the fan is running. That includes the default state button when the fan is the only thing running. I indicate what the HVAC is doing via the button color (goldenrod for heat pump heating, gold for furnace heating, blue for cooling, and a default blue shade when none of those things are active). I don't differentiate cooling by heat pump or otherwise since there is no otherwise for cooling in my house.
Here is the YAML configuration of that button:
type: custom:button-card name: HVAC color_type: label-card color: var(--label-badge-blue) icon: mdi:fan-auto entity: sensor.hvac_cooked_state triggers_update: sensor.hvac_cooked_state styles: card: - width: 80px - height: 72px state: - value: cooling color: blue spin: true - value: heatpump color: goldenrod spin: true - value: heating color: gold spin: true - value: fanonly spin: true - operator: default spin: false tap_action: action: navigate navigation_path: /wjc-subpanels/climate-details?wp_enabled=true double_tap_action: action: navigate navigation_path: /wjc-subpanels/ventbots?wp_enabled=trueThe list of states for sensor.hvac_cooked_state is examined in order, and the first matching value determines the color of the button and whether the fan icon spins.
Where does sensor.hvac_cooked_state come from? I did quite a bit of trial and error before getting things the way i wanted them. Along the way, I defined a series of Home Assistant template helper entities, some as binary sensors and some as sensors that reported text strings. The evolutionary end result isn't necessarily the optimal way to factor things, but I'm happy enough with it. Some of them end up being mere renamings of things that are directly available. But, if there's one thing programmers love more than caffeine, it's layers of abstraction. For organizational convenience, I named them all with the prefix "HVAC" and affiliated them with my smart thermostat device, CarpOBee. For consistency, I gave all of the binary sensor helpers a device class of Power (providing values of "on" or "off").
The affiliation with the device causes them...
Read more » -
Booting Crankshaft-NG from USB
09/01/2024 at 22:04 • 0 commentshttps://getcrankshaft.com/ Is a software bundle for using a Raspberry Pi and attached touchscreen display as a DIY Android Auto head unit. The project has been dormant for a couple of years, but that hasn't stopped me from poking around at it. One of the clever things they do is mount the boot and root filesystem read-only to minimize the chance of SD card corruption, which is one of the banes of SD cards with Linux. The selectively make the filesystems writable when they need to store some persistent thing, like a config update. The usual reason for wanting to operate from a USB thumb drive is minimized. However, because of the physical geometry of my screen and the case I printed for it, it's a tremendous amount of trouble to get the SD card out and back in once things are assembled.
So, I want to skip the SD card and operate directly from a USB thumb drive. I'm using a Raspberry Pi 3B+, which can boot from USB out of the box. Some things in the Crankshaft layer assume you are using an SD card and prevent booting and operating from USB. I've worked through the changes needed to get it working, and here are the details.
There are the usual two Linux filesystems involved: the boot filesystem and the root filesystem. Crankshaft assumes those are /dev/mmcblk0p1 and /dev/mmcblk0p2 (SD card partitions), respectively. The USB drive will typically have those same filesystems on /dev/sda1 and /dev/sda2, respectively. That's not guaranteed if you have other things involved, so it's better to identify them by the partition UUID. I assume you're doing your image-making on some Linux machine. With the USB drive plugged into that machine, you can get the partition UUIDs via the blkid command:
$ blkid /dev/sda1: LABEL_FATBOOT="boot" LABEL="boot" UUID="BBBB-AAAA" TYPE="vfat" PARTUUID="abcdefab-01" /dev/sda2: LABEL="rootfs" UUID="ffffffff-eeee-dddd-cccc-bbbbbbbbbbbb" TYPE="ext4" PARTUUID="abcdefab-02"The thing we're interested in is the PARTUUID. The following steps assume you have the partitions of your thumb drive actually mounted on some Linux machine. You may need to be root to do some of the steps, depending on your local configuration of that Linux machine.
Caution: It's possible to end up with partitions on different devices having the same partition UUID. Using both devices on the same host can result in a lot of confusion and chaos. The smart thing to do for that case is to change the partition UUIDs on at least one of them. This thread has some good information about how to do that: https://askubuntu.com/questions/1250224/how-to-change-partuuid
In the root directory of the "boot" filesystem (/dev/sda1 in my example), there is a text file cmdline.txt that supplies command line parameters to the kernel at boot time. It's quite long but looks something like this:
console=tty3 root=/dev/mmcblk0p2 ro rootfstype=ext4 ....
With a text editor, change the "root=" part to reference your root filesystem partition (/dev/sda2 in my example). Instead of a device name, use the partition UUID. For example,
console=tty3 root=PARTUUID=abcdefab-02 ro rootfstype=ext4 ....
With no SD card inserted, the RPi's boot sequence stuff will find the boot partition on your thumb drive, and the above change will tell it where to find the root partition. But more tricks are needed.
In the "etc" directory of the root filesystem is the standard fstab file that tells Linux what filesystems to mount where. For the Crankshaft image, it will look something like this:
proc /proc proc defaults,noatime,nodiratime 0 0 /dev/mmcblk0p1 /boot vfat ro,defaults,noatime,nodiratime 0 2 /dev/mmcblk0p2 / ext4 defaults,noatime,nodiratime 0 1 ramfs /tmp ramfs size=128m,nodev,nosuid,noatime,nodiratime 0 0 ramfs /var/tmp ramfs size=16m,nodev,nosuid,noatime,nodiratime 0 0 ramfs /var/log ramfs size=16m,nodev,nosuid,noatime,nodiratime 0 0
(followed by several more "ramfs" mounts, which are irrelevant for this discussion)....
Read more »
WJCarpenter
Benchoff



Patrick Van Oosterwijck
joey castillo
joekutz
Turo Heikkinen
Max.K
Michael Mogenson
Anand
Ben
timonsku
andriy.malyshenko
Omar Khorshid
Charitha Jayaweera
Insapio Limited Company
Fangzheng Liu
PJK
Aric Caley
Thanks for following my #wESP32: Wired ESP32 with Ethernet and PoE project!