We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hey guys,
This might be a silly question, but havnt found anything regarding this in the forums so here i go -
im doing a project which involves using the video library. as of now i have positioned the videos within the applet window as such -
void draw() {
background(0);
set(0,0,movies[idx] );
}
now some of these videos are of high resolution ( so they are getting cut out of my applet window ) and some are really small, so they are aligning to the top left corner of the applet ) I want the videos to fit within the width of the applet and align itself such that it stays in the middle of the window. ( just the way a quicktime or a vlc player would do it )
so thats the issue. Please help!
thanks!
Answers
haha okay. do let me know
thanks TfGuy44! but the code you have given is for centre aligning images right? how do i do that for video. im attaching my code. i tried to integrate what you have given my exisitng code and it is not working ( because of my complete in ability to code :( ) please could you have a look and suggest how i could do this same centre align thing for videos. Thanks
Function set() ignores any effects and simply stamps raw! For resizing and other fxs, we need image(). :-B
image(movies[idx], width>>1, height>>1, width, height); // for imageMode(CENTER)
Be aware that smooth() determines resizing quality too! For JAVA2D,
smooth(4);
is highest. (*)hey GoToLoop! the problem is when is use image(); the video doesnt show up at all. all i can hear is the audio of the video :( im attaching my code till the void draw();..
import processing.serial.*; import processing.video.Movie; import ddf.minim.spi.*; import ddf.minim.signals.*; import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.ugens.*; import ddf.minim.effects.*;
I see you're mixing my advise w/ @TfGuy44's! #-o
He's advised on translate() + scale(). While I tipped about image() w/ 5 parameters!
You gotta experiment w/ both and check which 1 is better for yourself! ;)
o ok :( looks like il dig in on that tomorrow!
okayy @GoToLoop! once again you were right! only issue is the videos are getting stretched to cover my entire screen. So what i did was, since all my final videos are going to be 1920 X 1080, their equivalent size on my screen ( which is 1440 X 900 ) would be 1440 X 810. So i wrote the following -
image( movies[idx] , width >> 1, height >> 1, 1440, 810 );
this seems to be doing the job..thanks again!
@TfGuy44 i tried your code as well, but just not able to get it to work, im sure im doing something wrong! thanks a bunch anyway.