//读取文件属性
EnumMT := TEnumMediaType.Create(OpenDialog.FileName);
if EnumMT.Count > 0 then
for i := 0 to EnumMT.Count - 1 do
debug.lines.Add(EnumMT.MediaDescription[i]);
EnumMT.Free;
function GetMediaTypeDescription(MediaType: PAMMediaType): string;
begin
// major types
result := 'Major Type: ';
if IsEqualGUID(MediaType.majortype,MEDIATYPE_AnalogAudio) then result := result+'AnalogAudio' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_AnalogVideo) then result := result+'Analogvideo' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Audio) then result := result+'Audio' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_AUXLine21Data) then result := result+'AUXLine21Data' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_File) then result := result+'File' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Interleaved) then result := result+'Interleaved' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_LMRT) then result := result+'LMRT' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Midi) then result := result+'Midi' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_MPEG2_PES) then result := result+'MPEG2_PES' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_ScriptCommand) then result := result+'ScriptCommand' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Stream) then result := result+'Stream' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Text) then result := result+'Text' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Timecode) then result := result+'Timecode' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_URL_STREAM) then result := result+'URL_STREAM' else
if IsEqualGUID(MediaType.majortype,MEDIATYPE_Video) then result := result+'Video' else
result := result+'UnKnown ';
// sub types
result := result + ' - Sub Type: ';
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_CLPL) then result := result+'CLPL' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_YUYV) then result := result+'YUYV' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_IYUV) then result := result+'IYUV' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_YVU9) then result := result+'YVU9' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Y411) then result := result+'Y411' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Y41P) then result := result+'Y41P' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_YUY2) then result := result+'YUY2' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_YVYU) then result := result+'YVYU' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_UYVY) then result := result+'UYVY' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Y211) then result := result+'Y211' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_YV12) then result := result+'YV12' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_CLJR) then result := result+'CLJR' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_IF09) then result := result+'IF09' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_CPLA) then result := result+'CPLA' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MJPG) then result := result+'MJPG' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_TVMJ) then result := result+'TVMJ' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_WAKE) then result := result+'WAKE' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_CFCC) then result := result+'CFCC' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_IJPG) then result := result+'IJPG' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Plum) then result := result+'Plum' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVCS) then result := result+'DVCS' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVSD) then result := result+'DVSD' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MDVF) then result := result+'MDVF' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB1) then result := result+'RGB1' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB4) then result := result+'RGB4' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB8) then result := result+'RGB8' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB565) then result := result+'RGB565' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB555) then result := result+'RGB555' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB24) then result := result+'RGB24' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RGB32) then result := result+'RGB32' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_ARGB32) then result := result+'ARGB32' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Overlay) then result := result+'Overlay' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1Packet) then result := result+'MPEG1Packet' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1Payload) then result := result+'MPEG1Payload' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1AudioPayload) then result := result+'MPEG1AudioPayload' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1System) then result := result+'MPEG1System' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1VideoCD) then result := result+'MPEG1VideoCD' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1Video) then result := result+'MPEG1Video' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG1Audio) then result := result+'MPEG1Audio' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Avi) then result := result+'Avi' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Asf) then result := result+'Asf' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_QTMovie) then result := result+'QTMovie' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_QTRpza) then result := result+'QTRpza' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_QTSmc) then result := result+'QTSmc' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_QTRle) then result := result+'QTRle' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_QTJpeg) then result := result+'QTJpeg' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_PCMAudio_Obsolete) then result := result+'PCMAudio_Obsolete' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_PCM) then result := result+'PCM' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_WAVE) then result := result+'WAVE' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AU) then result := result+'AU' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AIFF) then result := result+'AIFF' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_dvsd_) then result := result+'dvsd_' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_dvhd) then result := result+'dvhd' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_dvsl) then result := result+'dvsl' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Line21_BytePair) then result := result+'Line21_BytePair' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Line21_GOPPacket) then result := result+'Line21_GOPPacket' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_Line21_VBIRawData) then result := result+'Line21_VBIRawData' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DRM_Audio) then result := result+'DRM_Audio' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_IEEE_FLOAT) then result := result+'IEEE_FLOAT' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DOLBY_AC3_SPDIF) then result := result+'DOLBY_AC3_SPDIF' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_RAW_SPORT) then result := result+'RAW_SPORT' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_SPDIF_TAG_241h) then result := result+'SPDIF_TAG_241h' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DssVideo) then result := result+'DssVideo' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DssAudio) then result := result+'DssAudio' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_VPVideo) then result := result+'VPVideo' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_VPVBI) then result := result+'VPVBI' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_NTSC_M) then result := result+'AnalogVideo_NTSC_M' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_B) then result := result+'AnalogVideo_PAL_B' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_D) then result := result+'AnalogVideo_PAL_D' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_G) then result := result+'AnalogVideo_PAL_G' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_H) then result := result+'AnalogVideo_PAL_H' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_I) then result := result+'AnalogVideo_PAL_I' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_M) then result := result+'AnalogVideo_PAL_M' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_N) then result := result+'AnalogVideo_PAL_N' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO) then result := result+'AnalogVideo_PAL_N_COMBO' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_B) then result := result+'AnalogVideo_SECAM_B' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_D) then result := result+'AnalogVideo_SECAM_D' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_G) then result := result+'AnalogVideo_SECAM_G' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_H) then result := result+'AnalogVideo_SECAM_H' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_K) then result := result+'AnalogVideo_SECAM_K' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_K1) then result := result+'AnalogVideo_SECAM_K1' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_AnalogVideo_SECAM_L) then result := result+'AnalogVideo_SECAM_L' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG2_VIDEO) then result := result+'MPEG2_VIDEO' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG2_PROGRAM) then result := result+'MPEG2_PROGRAM' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG2_TRANSPORT) then result := result+'MPEG2_TRANSPORT' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MPEG2_AUDIO) then result := result+'MPEG2_AUDIO' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DOLBY_AC3) then result := result+'DOLBY_AC3' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVD_SUBPICTURE) then result := result+'DVD_SUBPICTURE' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVD_LPCM_AUDIO) then result := result+'DVD_LPCM_AUDIO' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DTS) then result := result+'DTS' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_SDDS) then result := result+'SDDS' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVD_NAVIGATION_PCI) then result := result+'PCI' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVD_NAVIGATION_DSI) then result := result+'DSI' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER) then result := result+'PROVIDER' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_MP42) then result := result+'MS-MPEG4' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_DIVX) then result := result+'DIVX' else
if IsEqualGUID(MediaType.subtype,MEDIASUBTYPE_VOXWARE) then result := result+'VOXWARE_MetaSound' else
result := result+'UnKnown ';
// format
result := result+ ' Format: ';
if IsEqualGUID(MediaType.formattype,FORMAT_VideoInfo) then
begin
result := result+'VideoInfo ';
if ((MediaType.cbFormat > 0) and assigned(MediaType.pbFormat)) then
with PVideoInfoHeader(MediaType.pbFormat)^.bmiHeader do
result := result + format('%s %dX%d, %d bits',
[GetFOURCC(biCompression), biWidth, biHeight, biBitCount]);
end
else
begin
if IsEqualGUID(MediaType.formattype,FORMAT_VideoInfo2) then
begin
result := result+'VideoInfo2 ';
if ((MediaType.cbFormat > 0) and assigned(MediaType.pbFormat)) then
with PVideoInfoHeader2(MediaType.pbFormat)^.bmiHeader do
result := result + format('%s %dX%d, %d bits',
[GetFOURCC(biCompression), biWidth, biHeight, biBitCount]);
end
else
begin
if IsEqualGUID(MediaType.formattype,FORMAT_WaveFormatEx) then
begin
result := result+'WaveFormatEx: ';
if ((MediaType.cbFormat > 0) and assigned(MediaType.pbFormat)) then
begin
case PWaveFormatEx(MediaType.pbFormat)^.wFormatTag of
$0001: result := result+'PCM'; // common
$0002: result := result+'ADPCM';
$0003: result := result+'IEEE_FLOAT';
$0005: result := result+'IBM_CVSD';
$0006: result := result+'ALAW';
$0007: result := result+'MULAW';
$0010: result := result+'OKI_ADPCM';
$0011: result := result+'DVI_ADPCM';
$0012: result := result+'MEDIASPACE_ADPCM';
$0013: result := result+'SIERRA_ADPCM';
$0014: result := result+'G723_ADPCM';
$0015: result := result+'DIGISTD';
$0016: result := result+'DIGIFIX';
$0017: result := result+'DIALOGIC_OKI_ADPCM';
$0018: result := result+'MEDIAVISION_ADPCM';
$0020: result := result+'YAMAHA_ADPCM';
$0021: result := result+'SONARC';
$0022: result := result+'DSPGROUP_TRUESPEECH';
$0023: result := result+'ECHOSC1';
$0024: result := result+'AUDIOFILE_AF36';
$0025: result := result+'APTX';
$0026: result := result+'AUDIOFILE_AF10';
$0030: result := result+'DOLBY_AC2';
$0031: result := result+'GSM610';
$0032: result := result+'MSNAUDIO';
$0033: result := result+'ANTEX_ADPCME';
$0034: result := result+'CONTROL_RES_VQLPC';
$0035: result := result+'DIGIREAL';
$0036: result := result+'DIGIADPCM';
$0037: result := result+'CONTROL_RES_CR10';
$0038: result := result+'NMS_VBXADPCM';
$0039: result := result+'CS_IMAADPCM';
$003A: result := result+'ECHOSC3';
$003B: result := result+'ROCKWELL_ADPCM';
$003C: result := result+'ROCKWELL_DIGITALK';
$003D: result := result+'XEBEC';
$0040: result := result+'G721_ADPCM';
$0041: result := result+'G728_CELP';
$0050: result := result+'MPEG';
$0055: result := result+'MPEGLAYER3';
$0060: result := result+'CIRRUS';
$0061: result := result+'ESPCM';
$0062: result := result+'VOXWARE';
$0063: result := result+'CANOPUS_ATRAC';
$0064: result := result+'G726_ADPCM';
$0065: result := result+'G722_ADPCM';
$0066: result := result+'DSAT';
$0067: result := result+'DSAT_DISPLAY';
$0075: result := result+'VOXWARE'; // aditionnal ???
$0080: result := result+'SOFTSOUND';
$0100: result := result+'RHETOREX_ADPCM';
$0200: result := result+'CREATIVE_ADPCM';
$0202: result := result+'CREATIVE_FASTSPEECH8';
$0203: result := result+'CREATIVE_FASTSPEECH10';
$0220: result := result+'QUARTERDECK';
$0300: result := result+'FM_TOWNS_SND';
$0400: result := result+'BTV_DIGITAL';
$1000: result := result+'OLIGSM';
$1001: result := result+'OLIADPCM';
$1002: result := result+'OLICELP';
$1003: result := result+'OLISBC';
$1004: result := result+'OLIOPR';
$1100: result := result+'LH_CODEC';
$1400: result := result+'NORRIS';
else
result := result+'Unknown';
end;
with PWaveFormatEx(MediaType.pbFormat)^ do
result := result + format(', %d Hertz, %d Bits, %d Channels',
[nSamplesPerSec, wBitsPerSample, nChannels]);
end;
end
else
begin
if IsEqualGUID(MediaType.formattype,FORMAT_MPEGVideo) then
begin
result := result+'MPEGVideo ';
if ((MediaType.cbFormat > 0) and assigned(MediaType.pbFormat)) then
with PMPEG1VIDEOINFO(MediaType.pbFormat)^.hdr.bmiHeader do
result := result + format('%s %dX%d, %d bits',
[GetFOURCC(biCompression), biWidth, biHeight, biBitCount]);
end
else
begin
if IsEqualGUID(MediaType.formattype,FORMAT_MPEG2Video) then
begin
result := result+'MPEGStreams ';
if ((MediaType.cbFormat > 0) and assigned(MediaType.pbFormat)) then
with PMPEG2VIDEOINFO(MediaType.pbFormat)^.hdr.bmiHeader do
result := result + format('%s %dX%d, %d bits',
[GetFOURCC(biCompression), biWidth, biHeight, biBitCount]);
end
else
begin // todo
if IsEqualGUID(MediaType.formattype,FORMAT_DvInfo) then result := result+'DvInfo' else
if IsEqualGUID(MediaType.formattype,FORMAT_MPEGStreams) then result := result+'MPEGStreams' else
if IsEqualGUID(MediaType.formattype,FORMAT_DolbyAC3) then result := result+'DolbyAC3' else
if IsEqualGUID(MediaType.formattype,FORMAT_MPEG2Audio) then result := result+'MPEG2Audio' else
if IsEqualGUID(MediaType.formattype,FORMAT_DVD_LPCMAudio) then result := result+'DVD_LPCMAudio' else
result := result+'Unknown';
end;
end;
end;
end;
end;
end;