Torchcodec stich new frames

Let’s say I have a pytorch model that produces a tensor of size (T, C, H, W) where T is the number of frames in a video clip.
Is there an efficient way to paste back this tensor into the original video? Let’s say I want to stitch it back at a given position that might change over the frames T?
Any suggestions are welcome, thanks!