I'm creating a video using MATLAB's video writer function but the video always shows in a different visual format. I'm creating the video from frames of another (videoIn.mp4) with resolution of 720 x 576.
When I reproduce videoIn.mp4 in a video reproducer, it shows correctly. But when I reproduce the one generated by MATLAB, it shows "compressed" on the sides (not wide enough).
Does anyone know how to fix it?
This is my code:
myVideo = VideoWriter('videoOut.mp4','MPEG-4');myVideo.FrameRate = 25; myVideo.Quality = 100; open(myVideo);videoObject = VideoReader('videoIn.mp4');framesToCopy = 1:50;for nFrame = 1:length(framesToCopy) mov(nFrame).cdata = readFrame(videoObject); writeVideo(myVideo,mov(nFrame).cdata);endclose(myVideo);
This is a screenshot of both videos open with VLC
Best Answer