Author Message

<  beginners  ~  Resize a video

PostPosted: Wed Dec 23, 2009 1:13 pm
Joined: Fri Feb 13, 2009 3:47 pmPosts: 3
Hello,

I wondered if there is a "resize" function for a video. I started my work based on MoviePlayerExample and can't find out how to resize the sample video with the hand at e.g(160x120)

any ideas ?
Thanks a lot.


Offline Profile
PostPosted: Wed Dec 23, 2009 1:57 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
if it's just for drawing it, it's so easy as:

Code:
movie.draw(x,y,160,120);


Offline Profile
PostPosted: Wed Dec 23, 2009 11:09 pm
Joined: Fri Feb 13, 2009 3:47 pmPosts: 3
ow ! That was easy ! So easy that I owe you some apologize for the disturbing ;)
Thanks for the answer.

I know stumble on a new problem. I am using "ofVideoPlayer:pixels" to get the value of all the pixels of a the upper horizontal row of my video. I want to use those values to define the color of each line I am tracing between the video and the top of my window. I just got blue or black and white. What's wrong in my code. How to get the color informations ?

unsigned char * pixels = vidPlayer.getPixels();

Code:
for (int i = 0; i < vidWidth; i+=1)
{
        unsigned char r = pixels[i * 3];
        unsigned char g = pixels[i * 3];
        unsigned char b = pixels[i * 3];
        ofSetColor(r, g, b);
        ofLine( (vidPositionX - vidWidth / 2 ) + i, 0, (vidPositionX - vidWidth / 2) + i, vidPositionY - vidHeight / 2);
}


Thanks in advance.
NB : I am amazed by the quickness of openFrameWorks ! :p


Offline Profile
PostPosted: Wed Dec 23, 2009 11:54 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
this:
Code:
        unsigned char r = pixels[i * 3];
        unsigned char g = pixels[i * 3];
        unsigned char b = pixels[i * 3];


should be:

Code:
        unsigned char r = pixels[i * 3];
        unsigned char g = pixels[i * 3+1];
        unsigned char b = pixels[i * 3+2];


Offline Profile
PostPosted: Mon Dec 28, 2009 8:16 pm
Joined: Fri Feb 13, 2009 3:47 pmPosts: 3
Thank you very much. Exactly what I was looking for ;)


Offline Profile
PostPosted: Wed Apr 28, 2010 1:31 pm
Joined: Wed Apr 28, 2010 1:27 pmPosts: 2
Try use the program VidCrop PRO, to me has very much helped.


Offline Profile

Display posts from previous:  Sort by:

All times are UTC
Page 1 of 1
6 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron