My desktop OS is Ubuntu 16.04 I am making a video from images using OpenCV videowriter. My image size is x=1920,y=1080 same as my screen size So my image shape is (y,x,3) Everything is correct as per me but I am getting wrong output with just static in it. Could it be an issue with OpenCV itself?
import numpy as np
import os
import cv2
import tkinter as tk
window = tk.Tk()
x = window.winfo_screenwidth()
y = window.winfo_screenheight()
video=cv2.VideoWriter('video.avi',cv2.VideoWriter_fourcc('X','V','I',D'),1,(x,y),True)
files = os.listdir()
final_files = []
for f in files:
if f.endswith('png'):
final_files.append(f)
else:
pass
for f in final_files:
img = cv2.imread(f)
print(img.shape)
video.write(img)
video.release()
I am getting static video output