MATLAB Answers

How to read video and save each video to CSV file

1 ビュー (過去 30 日間)
Kong
Kong 2020 年 3 月 13 日
編集済み: Jon 2020 年 3 月 13 日
Hello.
I want to read video and save each video to CSV file.
How can I fix the code this part?
csvwrite('how_to_save_each_file.csv',reader);
Thank you!
clear all
close all
%// read the video:
list = dir('*.avi')
% loop through the filenames in the list
for k = 1:length(list)
reader = VideoReader(list.name(k));
csvwrite('how_to_save_each_file.csv',reader);
end

  0 件のコメント

サインイン to comment.

採用された回答

Jon
Jon 2020 年 3 月 13 日
編集済み: Jon 2020 年 3 月 13 日
Hi Kong
clear all
close all
%// read the video:
list = dir('*.avi')
% loop through the filenames in the list
for k = 1:length(list)
reader = VideoReader(list.name(k));
% do some calculations that end up assigning an array called X
% make csv file whose name matches the avi file
[~,name] = fileparts(list.name(k)); % get the file name without the extension
outfile = strcat(name,'.csv')
csvwrite(outfile,X); % assumes you have already assigned the array X earlier
end
By the way, I see this is a follow up to your earlier question. Sorry I didn't see that you had left this as a comment in that thread. For continuity, might be better next time to try sending one more comment to ask if anyone had any further ideas. That way if I missed it the first time I might see it and be able to follow up.

  0 件のコメント

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。


Translated by