Those look like fungus gnats to me. I just went through that.They look and move exactly how mine did.
Literally the same little half size maggot looking things beneath my perlite layer.
And mine, for sure, were fungus gnats.
I wouldn't worry too much. Let the soil dry out almost completely a few times in a row and you will disrupt their life cycle. That should be enough, BUT...
If you need to work fast, you can use BT, Azamax, or mosquito dunks and soil drench. If you are in an enclosed area, you can let the adults die naturally with the dry soil (recommended); or you can use a bug bomb (enclosed space only), they are very sensitive to the no-mess bug bombs you can get from HD or Lowes. But those should be your LAST resort. I did try it and I found absolutely no problems, mess, or films with the "no-mess" foggers. Foggers were ESPECIALLY effective with thrips, BTW. One bomb and not a single thrip AT ALL since.