How to detect 3D video?

Still from the moview Finding Nemo. The image is split side by side.

Here's an interesting conundrum. My TV can automatically detect when 3D video is being played and offers to switch into 3D mode - but how does the detection work? This post will give you a few strategies for detecting 3D images using Python. Firstly, some terminology. 3D videos are usually saved either as Side-By-Side images, […] Read More

Adjusting timestamps on images with Python

As ever, mostly notes to myself. I have a bunch of old images which don't have any timestamp associated with them. This quick Python script will add a DateTime EXIF metadata tag to an image. This uses piexif which can be installed using pip install piexif This simple script reads a photo, adds a timestamp, […] Read More

Import Images From A Migrated WordPress

The Logo for WordPress

Here's how to solve a common WordPress problem. I want to re-import all my blog's images into the media library. I've moved my blog to a new host - but kept the same domain name. I started with a new WordPress install, the uploads folder still has all my images, but WordPress can't see them. […] Read More

Using YouTube to Transcode Videos to DASH on the Command Line

This is part of my redecentralisation efforts to liberate my videos from YouTube. MPEG-DASH is a simple method of streaming videos which doesn't require any specialised server software. You convert a high resolution video into a series of smaller resolution videos. You chop each of the videos up into several chunks. As the video plays, […] Read More

Previewing Circular Avatars

Play with the demo I was lucky enough to go to Number 10 Downing Street for a meeting a few weeks ago. A perfect opportunity for a photo of me by that famous door. Being the vain man that I am, I wanted to set it as my avatar photo. But Twitter and other social […] Read More

Fixing Broken Zip Files from Bandcamp - File name too long

I recently downloaded an album from Bandcamp. On trying to extract the zip file using Ubuntu, I got the error "File name too long." This is a known problem with Bandcamp. If you have a problem with long filenames in zip files, here's how to fix it. Quick Solution unzip -p -c "filename.ogg" > […] Read More

Amazon Alexa and Solar Panels

I can now query my solar panels via my Alexa Amazon Dot Echo thingie (why so many names?). I flatter myself as a reasonably competent techie and programmer, but fuck me AWS Lambdas and Alexa skills are a right pile of shite! Sorry if that sounds a bit harsh, but they're a pain in the […] Read More

Converting filenames to Title Case in Linux

Here's a simple bash one-liner to convert mixed-case filenames into Title Case: rename 's/(\S+)/\u\L$1/g' * This forces the file extension to lower-case as well. Use rename -n to test the command without changing anything on the filesystem. (Adapted from this PerlMonks FAQ.) Background I have a bunch of inconsistently named files like: HERE COMES THE […] Read More