MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   Splitting video into frames using matlab (https://www.labfans.com/bbs/showthread.php?t=22160)

poster 2019-11-26 18:24

Splitting video into frames using matlab
 
<p>Here is my code :</p>

<pre><code>video = VideoReader('Engineer.mp4');
NbOfImages = 30;
for img = 1:NbOfImages;
data = read(video, img);
filename=strcat('image',num2str(img),'.jpg');
listOfImages(img) = {filename};
imwrite(data, filename);
end
imageNames = listOfImages';
</code></pre>

<p>Works fine on matlab 2013a, but when i try to run it on matlab 2015b it gives me this error : </p>

<pre><code>Error using VideoReader/read (line 160)
The frame index requested is beyond the end of the file.

Error in tp2 (line 9)
data = read(video, img);
</code></pre>



[url=https://stackoverflow.com/questions/59048438/splitting-video-into-frames-using-matlab]More answer...[/url]


所有时间均为北京时间。现在的时间是 20:00

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.