In Keynote videos, "loop back and forth" drops frames when looping backward
If I insert a video into Keynote on MacOS and select "Loop back and forth" the forward part of the loop looks fine, but Keynote drops (lots of) frames when playing backwards. I'm not sure what controls how many frames are dropped—some small (file size) animations may be missing most of the frames while some larger animations may drop only every other frame or so, but it's not consistent with size. With most videos, the result is too embarrassing for me to use the loop back and forth feature in a real presentation.
Any ideas how to fix this? I make many of the videos, so changing the encoding may be an option. Most of the videos I've tried are mp4s with H.264 encoding.
Keynote 13.1 on macOS 12.7.5.
Mac Pro, macOS 12.7