Which codec is required?

  • Thread starter Thread starter UJ
  • Start date Start date
U

UJ

If I've got a video/audio file, how can I tell what Codec it needs? I want
to be able to let the user upload a file to a server but I want to make sure
before hand that the codec is already installed on the machine. If not I'll
tell them it won't work.

Any ideas how to do this?

(I don't want them to download codec - I just want to use the codecs I have
on the machine already.)

TIA - Jeff.
 
It all depends on the type of media file you're working with, as determined
by the file extension.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
The extension isn't always enough.

I keep having problems with video files that wont run because they need a
different version of the codec or some such thing.
 
UJ,
Depending on the type of media, you will probably have to find or write code
that parses the media headers. For example, an AVI file extension can be
anything from straight Windows uncompressed AVI video to DIVX.
Peter
 
Exactly, which is why I was mentioning the file extension. That is always
the first filter in terms of identifying the media type. It narrows it down
to one or a few possibles. After that, you need to read the bits of the file
itself, and that means that you have to know the byte order of the file
format.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
Where can I find the format for the different file types? If I at least had
that much I could parse apart the file.....
 
Hello UJ,

Look there http://groups.google.ru/group/micro...g/tree/browse_frm/thread/ff3bf11a816a5ccd/93c
May be this helps

U> If I've got a video/audio file, how can I tell what Codec it needs? I
U> want to be able to let the user upload a file to a server but I want
U> to make sure before hand that the codec is already installed on the
U> machine. If not I'll tell them it won't work.
U>
U> Any ideas how to do this?
U>
U> (I don't want them to download codec - I just want to use the codecs
U> I have on the machine already.)
U>
U> TIA - Jeff.
U>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Where can I find the format for the different file types? If I at least
had that much I could parse apart the file.....

That is the rub, eh? Since each file format is created by a different
vendor, you're not likely to find them all in one place. I know of one
resource that I have found helpful in the past:

http://www.wotsit.org/

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
No. Let's try again. Suppose I have an .avi file that has been compressed
using some codec. What I'd like to do is open the file and find out what
codec was used. If I don't have it loaded on the machine, I'll display an
error to the user saying that it's not playable.

There must be somewhere an object that will read an .avi file or an .mov
file and provide that kind of information.

TIA - Jeff.
 
Windows Media Player?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
UJ said:
No. Let's try again. Suppose I have an .avi file that has been compressed
using some codec. What I'd like to do is open the file and find out what
codec was used. If I don't have it loaded on the machine, I'll display an
error to the user saying that it's not playable.

There must be somewhere an object that will read an .avi file or an .mov
file and provide that kind of information.

This kind of functionality is built into win32 (look up "FourCC" and
"AVISTREAMINFO" &c.) It's also built into DirectShow (look up "FourCC"
again).

I don't know how you'd call this from C#/.net... I've never myself
tried. Maybe DirectShow is exposed as standard objects in .net. Maybe
instead for C# this article would be helpful:

http://www.codeproject.com/csharp/riffparser.asp
 
Back
Top