How do I convert from MP4 to AVI without any quality lost?

You can’t convert lossless
You can do it with as little of quality loss as possible, so there are no noticeable visible artifacts.
The best modern lossy codec is H264.
I usually use 3passes.

I use the formula to figure out the bitrate for the best quality:
width * height * framerate / 1024 = index

Divide the index by:
9 (if your source is VHS or TV visual quality)
8 (if your source is VHS or TV visual quality, but you need to keep a little bit better quality)

6 (if it’s DVD quality, to keep the file size smaller)
4 (if it’s DVD quality, to make it the highest visual quality possible or if your source is a cartoon type)

The resulting number will be the bitrate in Kilobits. I usually round it up to the nearest 10.
For example, if I got 756.56743, I round it to 760.

If you use the above formula, you will get very high quality results.

You can’t convert lossless HuffYUV format to small size lossy format without any quality loss.You can do it with as little of quality loss as possible, so there are no noticeable visible artifacts.The best modern lossy codec is H264.I usually use 3passes.I use the formula to figure out the bitrate for the best quality:width * height * framerate / 1024 = indexDivide the index by:9 (if your source is VHS or TV visual quality)8 (if your source is VHS or TV visual quality, but you need to keep a little bit better quality)6 (if it’s DVD quality, to keep the file size smaller)4 (if it’s DVD quality, to make it the highest visual quality possible or if your source is a cartoon type)The resulting number will be the bitrate in Kilobits. I usually round it up to the nearest 10.For example, if I got 756.56743, I round it to 760.If you use the above formula, you will get very high quality results.