VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member
    Join Date
    Sep 2002
    Location
    Central IL
    Search Comp PM
    Hello fellow programmers,

    I recently downloaded VB 2005 Express edition from Micro$oft (they are offering free downloads for a period of 1 year beginning with the release date of 11/05), and I'm attempting to write a simple GUI front-end for AVISynth, my favorite free tool for editing videos.

    VB 2005 Express comes with the .NET framework 2.0 and also allows COM components. I'm using the COM component for Windows MediaPlayer, but I don't know how to tell the # of frames, or the framerate of a clip. If I can't get # of frames, I can still figure it out based on the Frame Rate. I'd like to be able to do this for AVI's as well as MPG1/2 files.

    This is my first attempt at writing any video applications, and I'm relatively new to Windows Programming (about 2 years in VB, 5 writing plugins for CAD applications), although I've programmed for other platforms professionally for 12 years now.

    Thanks,
    CogoSWSDS
    Quote Quote  
  2. Member ChrissyBoy's Avatar
    Join Date
    Feb 2003
    Location
    Yorkshire!
    Search Comp PM
    Well in C#:

    Code:
    	// Get framerate
    	MediaDet md = new MediaDetClass(); 
    	md.Filename = "PATH_TO_YOUR_FILE"; 
    	md.CurrentStream =0;                     // choose the video stream
    	double FrameRate=md.FrameRate;

    Where MediaDetClass comes from the "Dexter 1.0 Type Library" COM object which you should see when you add a COM reference.

    VB should be easy to work out from the above.
    SVCD2DVD v2.5, AVI/MPEG/HDTV/AviSynth/h264->DVD, PAL->NTSC conversion.
    VOB2MPG PRO, Extract mpegs from your DVDs - with you in control!
    Quote Quote  
  3. Member
    Join Date
    Sep 2002
    Location
    Central IL
    Search Comp PM
    Thanks. I'll check it out when I get home tonight.

    CogoSWSDS
    Quote Quote  
  4. Member
    Join Date
    Sep 2002
    Location
    Central IL
    Search Comp PM
    Thanks. Here's the code as it worked in VB:

    At the top of the VB file, I put:
    Code:
    Imports DexterLib
    I added a reference to DexterLib 1.0 to the project. Then I used the following lines of code to get the frame rate for the clip:
    Code:
            Dim md As MediaDet
                Dim dFrameRate as double
                md = New MediaDetClass
                md.Filename = AxMediaPlayer1.FileName
                dFrameRate = md.FrameRate
    I was able to get the framerate of the clip this way, and store it in dFrameRate.

    Now if I can just get my datagrid of clip information to associate with the ADODB recordset, I'll be 90% of the way there. Anyone know how to use a datagrid without tying it to a database? I want to use the datagrid to keep track of the clips and attributes, and allow the users to modify them.

    CogoSWSDS
    Quote Quote  
  5. Member
    Join Date
    Jun 2005
    Location
    Portugal
    Search Comp PM
    Dexter is the best choice
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!