I want to read video then write to different video. Below is my code but video writer does not save anything. Help pls.
import numpy as np
import cv2
from tqdm import tqdm
inp = "./videos/a"
out = "b"
inpcap = cv2.VideoCapture(inp+".MP4")
outcap = cv2.VideoWriter(out+".MP4", cv2.VideoWriter_fourcc('H','2','6','4'), 30, (int(inpcap.get(3)),int(inpcap.get(4))))
print(inp)
print(out)
print(int(inpcap.get(3)),int(inpcap.get(4)))
i = 1
pbar = tqdm(total = 80000)
while(inpcap.isOpened()):
pbar.update(1)
ret, frame = inpcap.read()
if(ret == False):
break
outcap.write(frame)
inpcap.release()
outcap.release()