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 CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by