Changing to AVI may require a different encode
MP4 and AVI are containers, not single codecs. Some streams can be placed into another container, while a legacy destination may require the picture or sound to be encoded again. Confirm the target's supported video and audio formats before creating a large file.
An AVI may be much larger if the requested codec uses less compression. It may also be rejected if the wrong codec is inside. Inspect stream properties and test the exact application requirement rather than assuming that .avi guarantees compatibility.