The quality of a video in AVI or MP4 does not depend on the container format itself but on the codec used to encode the video. AVI (Audio Video Interleave) is an older container format that can hold different types of codecs, which might provide good quality but at the cost of larger file sizes.
MP4 (MPEG-4 Part 14) is a more modern and widely supported format that typically uses efficient codecs like H.264 or H.265, which offer excellent compression with minimal quality loss. MP4 is more optimized for streaming and internet use, delivering good quality at smaller file sizes compared to AVI.
In short, AVI can deliver good quality but tends to produce larger files, whereas MP4 offers better compression without significantly sacrificing video quality. Thus, for most cases, MP4 is preferred due to its balance between quality and file size.