Why a video is not straight?

Hi, I am displaying a video in a matlab GUIDE and i have this result
This is the code i am using for displaying the video
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
videoSrc = VideoReader('042.MOV');
while hasFrame(videoSrc)
vidFrame = readFrame(videoSrc);
image(vidFrame, 'Parent', handles.axes1);
set(handles.axes1, 'Visible', 'off');
pause(1/videoSrc.FrameRate);
end
clear obj
How can i get my video straight? When i used the media player it looks fine

3 Comments

Are you on a Mac? Like I said below, Windows people had to remove the .mov decoder.
Miguel Reina
Miguel Reina on 29 Dec 2017
Edited: Miguel Reina on 29 Dec 2017
Yes, I am on a Mac
R2017b on El Capitan, it works for me.
Try
implay('042.MOV');

Answers (2)

Image Analyst
Image Analyst on 20 Dec 2017
Looks like it doesn't understand the encoding. Can you use implay() instead?

6 Comments

Miguel Reina
Miguel Reina on 21 Dec 2017
Edited: Miguel Reina on 21 Dec 2017
I used the implay() but the error remains. Can you help me with getting the image straight? Herein the matrix. Then i can apply the image transformation to every frame.
What does it look like if you use a non-MATLAB program to play it?
Miguel Reina
Miguel Reina on 21 Dec 2017
Edited: Miguel Reina on 21 Dec 2017
The video is displayed perfectly in a program different than Matlab.
Can you post the original video? If not here, because of size limitations, then somewhere?
I can't even play it.
Error using VideoReader/init (line 619)
Unable to determine the codec required.
Error in VideoReader (line 172)
obj.init(fileName);
Error in test4 (line 1)
videoSrc = VideoReader('042.MOV');
Perhaps it was because of that emergency recall Apple had for Windows .mov decoders where they asked all windows users to uninstall Quicktime for Windows because of an unfixable security problem with it. Click here

This question is closed.

Asked:

on 20 Dec 2017

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!