movie resolution using getframe

4 Ansichten (letzte 30 Tage)
TVieira
TVieira am 20 Aug. 2012
hello.
I have a problem for generate a HD resolution movie (1920x1200) but as the computer monitor do not have HD resolution i cant using getframe function because each frame is the size of window plot (max resolution of computer monitor (1680x1050) and not as defined. for exemplo:
scrsz = get(0,'ScreenSize'); %getting the screensize of the 1 screen
figure('Position',[1 0 1920 1200],'MenuBar','none','ToolBar','none','resize','off') % fullscreen
% Prepare the new file.
vidObj = VideoWriter('peaks.avi');
open(vidObj);
% Create an animation.
Z = peaks; image(Z);
axis tight
set(gca, 'CLim',[0,1],'position',[0 0 1 1],'Visible','off')
for k = 1:20
imagesc(sin(2*pi*k/20)*Z),colormap jet
% Write each frame to the file.
currFrame = getframe;
writeVideo(vidObj,currFrame);
end
% Close the file.
close(vidObj);
So, the generated movie peaks.avi have a resolution of computer monitor and not (1920x1200).
what i do? exist other way to generate a movie without need plot a figure (using getframe)?
thank...

Akzeptierte Antwort

Image Analyst
Image Analyst am 20 Aug. 2012
Notice the third option for writeVideo:
writeVideo(writerObj,img) writes data from an image to a video file.
So create an image and then display the hi-res ( not HD because HD is only 1080 lines tall) image, and then call writeVideo(). I haven't tried it but it claims that it will write out the image, which can be any resolution, as opposed to currFrame which can only be as large as your monitor.
  1 Kommentar
TVieira
TVieira am 27 Aug. 2012
thanks but don't works. in the same way, is necessary plot a image to add a video frame and this plot is limited by monitor resolution.
I need a way to generate a video frame directly of a variavel(.mat or N x M x L matrix... whatever) without need plot a image.
any way thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by