'CV2 create blurry videos

import numpy as np
import cv2
size = 80,80
duration = 2
fps = 25
out = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc(*'X264'), fps, size)
for l in range(fps * duration):
    data = np.zeros( (80,80,3), dtype=np.uint8 )
    for k in range(80):
        data[40][k]=[255,0,0]
    out.write(data)
out.release()

When I want to create an video from an array of pixels (in the example a line, but I need to create more complex images) the result is very blurry and difficult to read.

Is there a specific format to create smooth pixels with cv2 or I need another video library?

For the input, it's an array 80*80 like in this code but with my data And I get the second image when converting to video

Imput

Output (same with .avi or .mp4)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source