The error is raised, because nn.Conv2d expect a 4D input in the shape [batch_size, channels, height, width], while you are apparently providing a 5D input as [batch_size, nb_frames, channels, height, width].
You could use nn.Conv3d for these shapes and maybe treat the nb_frames dimension as the depth?
Alternatively you could also pass each frame one by one to your current model, if that fits your use case.