If you want to install ffmpeg with xvid support in Debian you should consider using the debian-multimedia repository, which makes life a lot easier.
Append your sources.list as follows:
deb
http://www.debian-multimedia.org lenny main
deb-src
http://www.debian-multimedia.org lenny main
Then:
apt-get update
apt-get install debian-backports-keyring
apt-get install debian-multimedia-keyring
Then I follow the ubuntu guide for ffmpeg (with the debian-multimedia repository I find it works OK) which is located here:
http://ubuntuforums.org/showthread.php?t=786095
EDIT:
Also, if you are going down the path of using testing or unstable (sid) repositories, apt-pinning can save a lot of headaches with dependecies and corrupt installs. You can setup pinning to install from the 'unstable' only if the same package is not available in the stable repository. To do this:
Append your sources.list file as follows (use a local repository as per the link in my previous post):
deb
http://ftp.iinet.net.au/debian/debian/ stable main non-free contrib
deb-src
http://ftp.iinet.net.au/debian/debian/ stable main non-free contrib
deb
http://ftp.iinet.net.au/debian/debian/ testing main non-free contrib
deb-src
http://ftp.iinet.net.au/debian/debian/ testing main non-free contrib
deb
http://ftp.iinet.net.au/debian/debian/ unstable main non-free contrib
deb-src
http://ftp.iinet.net.au/debian/debian/ unstable main non-free contrib
Then create a file called preferences
vim /etc/apt/preferences
Append as follows:
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600
Good luck!