Solved

Get MPG, AVI, MOV,... properties

Posted on 2000-02-24
6
992 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Window placement 17 74
Best way to parse out a json string in VB6? 10 109
Access 2013 combo box not working 3 38
Spell Check in VB6 13 95
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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now