I wasn't given the spec, but I was told to see if I could solve the problem that all our 16:9 adverts were stored as 1:1.

As it was broadcast, and we had a billion different versions of the same add (localisation) it was something that needed automating, as sending it through the blasted tape machines and back to get it into 16:9 was a faff, and the digital solution cost many thousands of pounds.

So I turned to my toolset, which at the time was googling to find the full spec and spending the next few days workout out how to flip the aspect ratio bit of the mpeg2 to flip it to 16:9/4:3 depending on the metadata. I did this using perl and binary regex. It worked great, better than the commercial tools. but still not 100% correct, because it turns out a good number of mpeg2 encoders kick out non-compliant data.

This was before the days of ffmpeg's `mpeg2_metadata=display_aspect_ratio=16/9`