Open Handbrake, open the .avi and then just select an Apple TV preset and choose the output directory and then press START.
I almost never had problems with Handbrake, unless the .avi file is using some strange codec, but I guess, they use Divx or Xvid in your files.