Converting video to frames, but frames have a discontinuity. The left part of the picture shows up on the right side of the picture.

1 view (last 30 days)
I use code to convert video into frames and the code works well. The code is as follows.
mov=mmreader('t.avi');
get(mov);
nFrames= mov.NumberOfFrames;
pickind='jpg';
for i=940:942
a=read(mov,i);
strtemp = strcat('/Users/YiZhang/Dropbox/YiZhang/liquid bridge from Yizhang/Experiment/March 2015/27th Mar 2015/',int2str(i),'.',pickind);
imwrite(a,strtemp);
end
However, the images have a discontinuity. On the right side of the picture, you can clearly see a breakage, shown as a vertical line. And the left part of the picture is shown on the right side. Could anybody help me solve the problem? Please....

Answers (1)

Image Analyst
Image Analyst on 28 Mar 2015
mmreader() is an old, deprecated function. Use VideoReader() as shown in my attached demo.
  2 Comments
Ivy Zhang
Ivy Zhang on 28 Mar 2015
Thanks for your answer. Actually, I tried mmreader() and VideoReader() in both ways. But even if I used VideoReader, the export images don't have any difference.
Image Analyst
Image Analyst on 29 Mar 2015
If you view the video in something like Windows Media Player or QuickTime, is there a shift to it? Can you attach the video with the paper clip icon? Does it happen for all images, like even for the traffic.avi or rhinos.avi videos that ship with MATLAB, or does it happen just for that one video?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!