Sometimes when you import a video in after effects and during rendering the video gets glitchy or shaky. This is how to fix imported video rendering glitches.
1, you want to convert the video to mp4 again.
2, erase your phone caches follow directions here for Galaxy S8:
3, edit and purge in after effects, this is very important.
4, you want to delete the caches in the folders in after effects follow directions here to do this its pretty simple.