How to upscale low-res videos to HD with ffmpeg

If you have some spare brain cycles for the weekend, here's a tutorial on how to upscale low-resolution videos to HD quality using the ffmpeg media processing tool, including practical limitations, upscaling with different aspect ratios, video padding, use of motion filters and unsharpen mask, results with 720p and 1080p output, transcoding performance, use of CPU and GPU codecs, smart TV…