How to convert h264 avi video to VMS DirectShow avi format ?

How I can convert my h264 avi video into the video accepted by DirectShow ?

as mention in this thread https://developer.milestonesys.com/s/question/0D50O00003V9qIDSAZ/virtaual-camera-added-to-the-vms-but-not-able-to-view-with-direct-show-driver

I found out that when I save video from VMS client it is accepted by direct show and the codec for video is msvideo1.

I was not able to convert to that codec neither with VLC, nor with gstreamer.

It turns out ffmpeg can convert to msvideo, but it will be slow (encoding has the same fps as original video)

ffmpeg -i input.avi -c:v msvideo1 output.avi