How can I get MATLAB to play a video without delay?
조회 수: 2 (최근 30일)
이전 댓글 표시
I want MATLAB to display and start a video right away. Timing is important for me. The implay() function brings up a GUI that the video can be started in but how do I get the video to start automatically?
Evan
댓글 수: 0
답변 (1개)
Matthew Eicholtz
2016년 2월 22일
Assuming you have the Computer Vision System Toolbox, you can use VideoFileReader and VideoPlayer objects.
doc vision.VideoPlayer
Use the step method to get the next frame from the reader as well as to send the frame to the player.
reader = vision.VideoFileReader('tilted_face.avi');
player = vision.VideoPlayer;
while ~isDone(reader)
frame = step(reader); %get the next frame in the video
step(player,frame); %show the frame
end
release(reader);
release(player);
댓글 수: 1
Walter Roberson
2016년 2월 22일
Note that it will take time to create the reader and player objects. However, you are not required to output any data to the player until you are ready with your other timing. (I have not used the player myself; it might turn out to be advisable to output a frame of zeros first thing until you are ready to actually display frames.)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!