There is still no answer, so I found a workaround:
In the on_movie_end event for motion.conf, I run a command that converts my .avi file to .mp4
ffmpeg -i% f -c: v libx264 -c: copy of myvideo.mp4
( % f will be the full path for the video file)
Works like a charm
source share