フィルターのクリア

Can't get video's number of frames before processing?

1 回表示 (過去 30 日間)
Liran
Liran 2014 年 7 月 28 日
コメント済み: Walter Roberson 2016 年 4 月 21 日
I used videoReader--> read but i get "[]" in the number of frames field. i have tried using vision.VideoFileReader but it gives a less informative header ( without that kind of information)
I need the frame number BEFORE processing , not after. I am uploading the video so you could try yourselves

採用された回答

Dinesh Iyer
Dinesh Iyer 2014 年 7 月 29 日
Hi Lirian,
The vision.VideoFileReader system object allows reading only one frame at a time and does not allow random access.
I tried to open this file using Windows Media Player but was unable to do so. I believe I need some additional codecs as you mentioned.
Can you try to force VideoReader to read the last frame as below
if true
vidObj = VideoReader('swipeCut.mp4');
read(vidObj, Inf);
vidObj.NumberOfFrames
end
This should display the last frame read. However, this operation might take time depending upon the size of the video.
I am curious however as to why you need the total number of frames?
Hope this helps.
Dinesh
  3 件のコメント
PRUDHVI RAJU
PRUDHVI RAJU 2016 年 4 月 21 日
編集済み: Walter Roberson 2016 年 4 月 21 日
%
% Read Video
video = VideoReader('fp.avi');
%video = VideoReader('sv.mp4');
%no.of frames
nframes=video.NumberOfFrames;
Walter Roberson
Walter Roberson 2016 年 4 月 21 日
"Note: NumberOfFrames will be removed in a future release."

サインインしてコメントする。

その他の回答 (1 件)

Dima Lisin
Dima Lisin 2014 年 7 月 28 日
Thre maybe something wrong with the header of your video file. Can you try VideoReader on a different file?
  1 件のコメント
Liran
Liran 2014 年 7 月 28 日
編集済み: Liran 2014 年 7 月 28 日
i have used VideoReader on other videos and it was fine of course , but i really need to do it on this video (i attached it).
The video was recorded via "Rec." app on a Samsung Note 3 with android 4.4 (Kitkat) and this app records these videos the same way.
i don't know if it helps you figure out the problem but before i downloaded new codecs i couldn't even read the file at all.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by