Link to home
Start Free TrialLog in
Avatar of TheFaimousOne
TheFaimousOne

asked on

Issues with extracting the FOURCC codes...

I am trying to build a small program that will allow me to get the FOURCC codes from an AVI (media) file. What I would need is the complete code and all of the functions I would need to accomplish this. I know it will require an API call, and I have looked everywhere for documentation, but I can't seem to find any!

Here is what I want to build: A small program for a group of inexperienced users, so they can find out what Video codec is required and what Audio codec is required to watch a movie. I know there are already programs out there, but I want one that does just that, and nothing more.

This is probably so simple and I have just overlooked the detail somewhere, but I know it can be done, and it can be done in VB6.

So, I need the code to find the FOURCC in a video file. Who can help?!
Avatar of twalgrave
twalgrave

Here's a site to detect how many FOURCC Codes you have:
http://www.cse.unsw.edu.au/~atan164/ddraw_print.html

Here's MS sites about the FourCC code in use and how to get it.  You will need to convert the call to VB, and if you need help with that, let me know:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_4ilz.asp

The interface call
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_4307.asp

The PixelFormat Type:

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddref_5n3r.asp

Avatar of TheFaimousOne

ASKER

OK... I see that, but I need it laid out in layman's terms with code snippets. If you, or someone, would like to spend the time writing out the code for me with examples to UI (how it could be with a standard form, button and text or labels for the output) and the code for the background (API calls, regular code, etc.) I would be willing to sweeten the pot of points for ya!

All the help I can get would be awesome! I know VB to an extent, but have a little bit of a hard time with this sort of stuff!

Thanks a million!
ASKER CERTIFIED SOLUTION
Avatar of twalgrave
twalgrave

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
twalgrave: Well, I tried that, but unfortunately it has issues working with the new WMP9. It doesn't want to give back a code and tells me it won't work... I'm beginning to believe that it is a WMP issue, so I'll want to stay away from that... I found something similar to that and tried it earlier, but to no avail...

Thanks for your help tho!

All I want to really do is to find the info contained in the FOURCC in any AVI file. All I need to do is to be able to extract that info out of the movie. Just to be able to tell me what codecs I need for audio and video. Hopefully someone has the answer...
Moderators... I have solved this problem myself and wish to close this posting. Could you please give twalgrave 20 points for assisting me and pushing me in the right direction...? Thanks for your help twalgrave.

I would like to have 180 points put back into my account please (was giving away 200 for the question.) Thanks a lot!
Points reduced,

Now you can accept the comment as an answer

Computer101
E_E Admin
Thanks for the help!
TheFaimousOne,

Thanks for the points.  Can you post the solution or at least a synopsis?
Sure...

Well, I knew I would have to figure out the header from the first few hundred lines of the text. Knowing that, and knowing that I didn't want to open the file the whole way (which was one the the problems I was running into...), I had to try to figure something out to get the file open part way. That is when I realized I could use a simple Open|Get|Seek function. Using that, I was able to open the file, seek to certain spots, get the information from there and place them into strings. And when all was said and done, I didn't have to open the whole file... Although that was still an issue at first, until I realized I needed to use the Close function before reading it all! (Doh!)

Anyhow, I knew the locations of each setting (Bitrate, Width, Height, FOURCC, etc.) and how to decode it once I had it. I just thought it would require an API call, and I was wrong about that! All the info is stored in the actual 'header' of the file! Which is to say, it is all stored near the beginning of the file!

Once all the info was stored into a array of strings, all I had to do was semi-parse it, match it to its actual name (Snippet: Case "DIV5"
               lblCodecFound.Caption = "DivX 5"
               iscodec = "divxc32"
               ifcodec = "divxc32.dll") and then display it for the people that needed to see it. It really wasn't that hard after all! I just wish I would have KNOWN that!

Hope the info helps somebody... Since I scoured the net looking for something on this and FOUND NOTHING!!!

And thanks again for your help!