The formula I was trying to remember is on the track of what you want; see Jeff Pulera's post 2 and 7 here:
As John provides with the avi intermediate, I forgot to mention that as an option. You can use other intermediates, generlaly lossless. And yes, it adds time and they can be large files.