AVI RGB or BGR

  • Thread starter Thread starter Nuno Magalhaes
  • Start date Start date
N

Nuno Magalhaes

How to know when the frames in AVI file is RGB or BGR because sometimes
Red appears first and sometimes Blue appears first in uncompressed
frames.

Does *anyone* know why?
 
Nuno,

Unfortunately, AVI files are really containers for video and audio
streams. While there is a general specification for AVI files, the encoding
of the video and audio information is dependent on the encoding of the file
(which is what requires a specific codec).

You can get the encoding from the AVI file though, and then process
accordingly.

Hope this helps.
 
I'm using avifil32.dll through p/invoke and the problem persists. How
do I know when blue or red comes first in umcompressed (_RGB) videos?
What header field should I search? Windows Media Player seems to know
that perfectly.

Nuno,

Unfortunately, AVI files are really containers for video and audio
streams. While there is a general specification for AVI files, the encoding
of the video and audio information is dependent on the encoding of the file
(which is what requires a specific codec).

You can get the encoding from the AVI file though, and then process
accordingly.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Nuno Magalhaes said:
How to know when the frames in AVI file is RGB or BGR because sometimes
Red appears first and sometimes Blue appears first in uncompressed
frames.

Does *anyone* know why?
 
Nuno,

Windows Media Player actually doesn't know. Windows Media Player defers
to the DirectShow API, which reads the header, and then uses the appropriate
codecs to decode the file.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Nuno Magalhaes said:
I'm using avifil32.dll through p/invoke and the problem persists. How
do I know when blue or red comes first in umcompressed (_RGB) videos?
What header field should I search? Windows Media Player seems to know
that perfectly.

Nuno,

Unfortunately, AVI files are really containers for video and audio
streams. While there is a general specification for AVI files, the
encoding
of the video and audio information is dependent on the encoding of the
file
(which is what requires a specific codec).

You can get the encoding from the AVI file though, and then process
accordingly.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Nuno Magalhaes said:
How to know when the frames in AVI file is RGB or BGR because sometimes
Red appears first and sometimes Blue appears first in uncompressed
frames.

Does *anyone* know why?
 
Back
Top