(App Designer) Refresh rate low displaying high-res video in GUI created by AppDesigner

2 次查看(过去 30 天)
Hello, I am having trouble with the following test-function:
Load a short high-res video and display it in a GUI that was created using App Designer. With the
drawnow()
commented out, the stream doesn't display. With the
drawnow(),
I get only ~1fps.
Is there any other solution than downsampling the displayed image-stream (fewer pixels)?
function test()
close all;
% vidFullPath = 'traffic.mj2'; % low-res Matlab sample video: works
vidFullPath = 'sample.avi'; %1920x1080 video-snipped
vidSrc = vision.VideoFileReader(vidFullPath,'ImageColorSpace','RGB');
gui = test_GUI();
img = step(vidSrc);
imshow(img,'Parent',gui.UIAxes);
% drawnow();
while ~isempty(img)
imshow(step(vidSrc),'Parent',gui.UIAxes);
% drawnow();
end
end
Any help is greatly appreciated!
Thanks, tbn

回答(2 个)

Prajith Chilummula
Prajith Chilummula 2018-2-23
编辑:Prajith Chilummula 2018-2-23
Hello, can you try using
drawnow limitrate;
to increase the animation rate. Refer this link for more information:
https://www.mathworks.com/help/matlab/ref/drawnow.html

tbn
tbn 2018-2-23
Thanks Raghu ram for your answer.
drawnow limitrate
does not solve it. In the meantime, I received some feedback from the MathWorks Support team which basically tells me that - at this stage - I'd have to code my own GUI or use GUIDE in order to play video inside a custom GUI. They did reach out to their development team to improve this behavior. So there's hope.
tbn

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by