How to play video at specific timestamp?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Have a video that I want to play in a figure but at a specific time, like start 10 seconds into the video for example.
0 Kommentare
Antworten (1)
Geoff Hayes
am 31 Mär. 2015
matlabuser12 - consider using VideoReader to read the data from file starting at a specific index. For example,
% create the object
vidObj = VideoReader('myVideo.mp4');
% determine the number of frames per second
framesPerSecond = get(vidObj,'FrameRate');
% determine the number of frames
numFrames = get(vidObj,'NumberOfFrames');
% read all data from the 11th second
video = read(vidObj,[framesPerSecond*10 + 1 numFrames]);
video will be an array of video frames which you should then be able to play. Try implementing this and see what happens!
4 Kommentare
Siehe auch
Kategorien
Mehr zu Audio and Video Data finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!