How to queue a list of videos for analysis?

5 ビュー (過去 30 日間)
Mark Lepage
Mark Lepage 2017 年 10 月 30 日
回答済み: Mabin Mariam Joseph 2017 年 11 月 8 日
Hello,
I have a program written that does certain analysis on a video. However, I need to perform this analysis on many videos, thus is manually time consuming to load the next video into the program. Is there a way to queue a list of videos to be inputted in my program?
My pseudo code currently looks something like this:
obj = VideoReader('myVideo-1.MOV')
results = SOMEANALYSIS(obj)
My videos are in some form of myVideo-1, 'myVideo-2,..., myVideo-n, where n denotes the number of the video I am analysing.
Any input is appreciated.

採用された回答

Mabin Mariam Joseph
Mabin Mariam Joseph 2017 年 11 月 8 日
Hello Mark,
You can use create a 'FileDatastore' object that can hold all the video files. The 'ReadFcn' property of the datastore object is a function that reads the file data specified as a function handle. Please see the sample code below:
loc='location of the files';
fds = fileDatastore(loc,'ReadFcn',@myread,'FileExtensions','.mp4');
data = readall(fds);
function v = myread(file)
v=VideoReader(file);
end
You can also refer to the following MATLAB Documentation links for further information:
https://www.mathworks.com/help/matlab/ref/filedatastore.html
https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.readall.html
https://www.mathworks.com/help/matlab/datastore.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by