Improved and tested transcoding logic and configuration

I stopped short of implementing the actual video presets, this will take some experimentation, which takes time.  That will be done in a separate PR.  For now this fixes bugs and improves the configuration.

Closes #71
Closes #83
Closes #95