# write a video file opencv pycharm mp4

i'm trying to save my video to an mp4 file but at the moment to see the properties of the file saved it has only a few bytes. I proved to save in format .avi and in the folder always has 5.55 Kb. In the directory of pyCharm it shows an interrogation sign (?) I'm working with opencv-python 4.2. Sorry, i'm new in opencv.

import cv2
import numpy as np
import matplotlib.pyplot as plt

img = cv2.VideoCapture('SofiPepsi.mp4')
out = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc(*'XVID'), 25, (320,240))

while(1):