Add format detection via content inspection

This should allow us to confirm the integrity of files before starting
to process them. It will also allow us to support virtually every media
format under the sun.