In AudioLabeler, is it possible to export the frame # for each label?
2 次查看(过去 30 天)
显示 更早的评论
I am using AudioLabeler to load a video file to view the audio signal. When I export my labels, I only get the time information, but I would also like to export the frame #. Is that possible?
0 个评论
采纳的回答
Abhijeet
2023-4-4
Hi,
Yes, it is possible to export the frame number along with the time information when exporting labels from AudioLabeler.
In AudioLabeler, when you export labels, you can choose the export format. The default export format is CSV, but you can also export in other formats such as Excel or MATLAB.
If you export to the MATLAB format (.mat), you can export the frame number along with the time information by setting the 'SamplingRate' and 'StartFrame' fields of the exported struct.
For example, if your video has a frame rate of 30 frames per second and you want to export labels for a range of time from 1.5 seconds to 2.5 seconds, you can do the following:
video = VideoReader('myvideo.mp4');
label = audioLabeler(video);
% Define the range of time for the labels
startTime = 1.5;
endTime = 2.5;
% Get the frame number for the start and end times
startFrame = round(startTime * video.FrameRate) + 1;
endFrame = round(endTime * video.FrameRate);
% Export labels to a .mat file
exportLabels(label, 'mylabels.mat', 'Format', 'mat', ... 'SamplingRate', video.FrameRate, 'StartFrame', startFrame);
When you load the exported .mat file into MATLAB, you can access the labels along with the frame number by using the 'Time' and 'Frame' fields of the struct.
Thanks
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!