ffmpeg repackaging AVI (h264) into mp4 gives choppy playback in html5 video on chromium
I ran into this same stuttering after remuxing to mkv and then playing the video on a Roku.  Solved the issue by first fixing the avi with the mpeg4_unpack_bframes filter, then remuxing that as mkv.
See https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#mpeg4_005funpack_005fbframes
Posting here as this is the top Search result when searching &quot;avi to mkv stutter&quot;.