1. download the video/gif of your choosing (i personally use yt-dlp)
2. crop and trim the section of the video that you want to turn into a gif (you can just use the default Movies & TV app on PC to trim it)
3. go to https://ezgif.com/ and turn it into a gif (skip this step if it's already a gif)
4. crop it once again so that it fits the aspect ratio of the stamp template that you are choosing (i usually crop it to 198 x 112)
5. turn it into frames
6. now that you have the frames, open up krita and open a document with the template stamp that you have
6.5 (optional) resize the stamp by clicking on "scale image" so that the gif frames and stamp template are the same size
7. add in all of your gif frames, each one on a different layer
8. now you'll see that the edges of the frames poke outside of the stamp. select the inside of the stamp, invert selection, select all layers (by holding down ctrl and clicking each layer), press delete (and this way you'll delete the edges of all of the frames at once)
9. now this is the time consuming part. choose only one layer to be visible at a time (+the stamp layer) and save each frame manually, while being careful of the file name you're saving it under (this is so that you can remember the order of the frames)
10. go back to https://ezgif.com/ and select all of the frames (the ones with the stamp border, that you just saved in krita) and turn them into a gif. then you can adjust the speed as you want to and you're done!