I need to read frames from video file and create new video from these frames. Then I read the frames from the new video and I need these frames to be identical to frames I read from the original video.
This is what I done (for the example I did it with only one frame) -
Read frame from video:
vidcap = cv2.VideoCapture('video_name.mp4')
success,orig_frame = vidcap.read()
Write new video from this frame:
size = (1920,1080)
vidWriter = cv2.VideoWriter('new_video.mp4', cv2.VideoWriter_fourcc(*'MP4V'), 25, size)
vidWriter.write(orig_frame)
vidWriter.release()
Read frame from new_video:
vidcap = cv2.VideoCapture('new_video.mp4')
success,new_frame = vidcap.read()
Comparing orig_frame with new_frame shows that they are not identical.
orig_frame:
new_frame:
How can I get identical frames from original video and new video?