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!