LabNote: Open video files from MatLab in external program
- Description: Open videos in external program
- Keywords: avi, video, external program, external application, VirtualDub, WINanalyze3D, matlab
- Requirements:
- Disclaimer: Without warranty of any kind. Content may change.
- Language: english, matlab
- Author: T. Wöhrl
- URL: https://t-woehrl.net/p/20191111T193225/index.html
- License: MIT
Contents
Changelog
- 2020-10-11: Added link to DigitizingTools
- 2019-11-11: Created and published note
Initialize
clear all; close all; clc
version
Set path for external program
app = '"C:\Users\tw\app\win\VirtualDub 1.6\VirtualDub.exe"';
Set root for video data
datap = 'G:\archive\dat\120901_digitalization\';
Import metadata
exl = dataset('XLSFile','G:/tmp/metadata.xlsx','Sheet','Protokoll','range','A5:DZ2425');
Subsetting
filter = (char(exl.ant) == 'F' & exl.deg==60 & exl.spattern == 1);
s = exl(filter,exl.Properties.VarNames);
sum(filter);
Loop through video files, open in external program
for k = 1:length(s)
disp([num2str(k),'/',num2str(length(s))])
frame = s.td_force_plate(k)-1;
clipboard('copy',num2str(frame));
id = s.id{k};
eval(['!',app, ' ','"',datap,id,'\',id,'.avi"'])
end
Alternative: Open Digitizing Tool and relevant marker file
addpath('G:/DigitizingTools_20160711/');
for k = 1:length(s)
disp([num2str(k),'/',num2str(length(s))])
frame = s.td_force_plate(k)-1;
clipboard('copy',num2str(frame));
id = s.id{k};
cd([datap,id])
edit(['HedrickLab_pt2marker.csv'])
DLTdv6
keydown = waitforbuttonpress;
if (keydown == 0)
close all
continue
end
end