Thank you for your reply sir.  When I remove the Pytorch and just create video output, It works well. However, when I process the frame with the trained pytorch model, I can not open the saved video.  I have corsschecked it several time. Please, any other suggestions?