×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Getting the dimensions of a video?

Getting the dimensions of a video?

Getting the dimensions of a video?

(OP)
Hi,

i can add several videos to a timeline and play them, but im trying to size the movies into a specific area on screen keeping their aspect ratio. For this to happen successfully, i need to know the size (width and height) of the clip playing in the timeline (or just the timeline if all items are stretched).


Anyone help?
Thanks

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"

RE: Getting the dimensions of a video?

Timeline of what?  Do you mean something like Windows Movie Maker?  A DirectShow filter graph?

RE: Getting the dimensions of a video?

(OP)
yes, i have an app which is like windows movie maker.

im using a directshow timeline to compose videos etc.
i need to know about the different sizes of the videos on there

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"

RE: Getting the dimensions of a video?

In DirectShow, the video size is part of the media type negotiated when your filters connect.  Look in the format type, the VIDEOINFOHEADER or VIDEOINFOHEADER2 structure, depending on the media subtype.  Both these have a field of type BITMAPINFOHEADER called "bmiHeader".  In this structure, the video size is stored as the width/height fields, "biWidth" and "biHeight".

Also in VIDEOINFOHEADER/VIDEOINFOHEADER2 are source/target rectangles ("rcSource" and "rcTarget").  If these have non-zero values, they specify stretching/clipping rectangles.

This web page talks all about this stuff.

RE: Getting the dimensions of a video?

(OP)
yeah ive got that much, i was just wondering what you would do if you have 2 videos of different sizes on the same timeline, ie, a video of 400x100 and a video of 100x200. what size should the resulting video be in? at the moment im resorting to playing in any 4:3 size and stretching all the videos to fit.
ta

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"

RE: Getting the dimensions of a video?

It depends on what is mixing the videos together.  You can either stretch the videos like you're doing now (probably your best bet), or blt the smaller one into a rectangular sub-area inside the larger one.  I think it's up to you, what kind of effect you want.

RE: Getting the dimensions of a video?

(OP)
ok, cheers, will have a think about the 2nd option too!

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close