Solved

Get MPG, AVI, MOV,... properties

Posted on 2000-02-24
6
999 Views
Last Modified: 2012-08-14
Hi!
I need a function to get the properties of a Video file: MPG, AVI, MOV,...
The properties I need to get are:
  - duration of the video,
  - dimensions (width x height),
  - sound / no sound
  - ...
Thanks in advance!
0
Comment
Question by:jaumeg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 12

Expert Comment

by:pjknibbs
ID: 2557096
If you load the relevant movie into an ActiveMovie control, I think you can get at these properties via properties of the ActiveMovie control...certainly it has properties Duration, ImageSourceHeight and ImageSourceWidth.
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2557146
Add the Windows Media Player to your project by right-clicking the toolbox and selecting "Components..." then select "Windows Media Player" (MSDXM.OCX) from the list.

Add the media Player to your form.

Then set the following properties:

   MediaPlayer1.AutoStart = False
   MediaPlayer1.FileName = "whatever_your_movie_is.mpg"


Then, you can do the following:

    Dim lDuration As Double
    Dim lHeight As Long
    Dim lWidth As Long
    Dim lStreams As Long
   
    'GET MOVIE DURATION IN SECONDS
    lDuration = MediaPlayer1.Duration
    'GET MOVIE HEIGHT
    lHeight = MediaPlayer1.ImageSourceHeight
    'GET MOVIE WIDTH
    lWidth = MediaPlayer1.ImageSourceWidth
    'GET NUMBER OF STREAMS IN MOVIE, IF 0, NO AUDIO
    lStreams = MediaPlayer1.StreamCount


Make sure you're using the latest MediaPlayer... You can download version 6.4 from here:  http://www.microsoft.com/windows/mediaplayer/en/default.asp?RLD=58


Cheers!


0
 

Author Comment

by:jaumeg
ID: 2557592
Well! The Media Player OCX is a possible solution, but I don't want to depend of a OCX. For the moment I've found the way to get the info or an AVI file, using API functions. I'm interested in the same but for the MPG, MOV,... files.
thanks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:pjknibbs
ID: 2557672
The problem is, there's no support in Windows for MPG or MOV movies other than through the Windows Media Player, so you can't get the information you want using APIs.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 150 total points
ID: 2557679
Well, if you don't want to use an OCX (I don't know why... It's a resource, just like an API is.), You are going to have to open the file and READ it yourself to get the information.

Go to this site: http://wotsit.org/ and do a search on MPG and MOV.  The file formats for each of these file types are there...


Cheers!
0
 

Expert Comment

by:jbouwh
ID: 22442467
The URL mentioned is dead.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question