GraphEdit 檔案格式
[與此頁面相關聯的功能,DirectShow是舊版功能。 它已被 MediaPlayer、imfMediaEngine 取代,並在媒體基金會 音訊/視訊擷取。 這些功能已針對 Windows 10 和 Windows 11 進行優化。 Microsoft強烈建議新程式代碼盡可能在媒體 基礎中使用 MediaPlayer、IMFMediaEngine 和 音訊/視訊擷取,而不是 DirectShow。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
當 GraphEdit 公用程式儲存 DirectShow 篩選圖形時,它會建立擴展名為 .grf 的記憶體檔案。 記憶體檔案包含名為 ActiveMovieGraph 的單一數據流。 此數據流包含所有篩選、篩選名稱、檔名、連線等相關信息。
下列文法會使用修改的 BNF (Backus-Naur Form) 語法,描述數據流內圖表的語法:
<graph> ::=
0003\r\n<filters><connections><clock>
END |
0002\r\n<filters><connections>
END
<filters> ::=
FILTERS<b>
[<filter list><b>
]
<filter list> ::= <filter><b>
[<filter list>
]
<filter> ::= <filter id><b><name><b><class id><b>
[<file>
]<length><b1><filter data>
<class id> ::= <guid>
<file> ::=
SOURCE <name><b> |
SINK <name><b>
<connections> ::=
CONNECTIONS<b>
{<connection><b>
}
<connection> ::= <filter id><b><pin id><b><filter id><b><pin id><b><media type>
<filter id> ::= <id>
<pin id> ::= <name>
<media type> ::= <sample size><major type><b><subtype><b><flags><format>
<major type> ::= <guid>
<subtype> ::= <guid>
<flags> ::= <fixed sample size><b><temporal compression><b>
<fixed sample size> ::= 1
| 0
<temporal compression> ::= 1
| 0
<format> ::= <length><b1><format type><b><length><b1><format data>
<format type> ::= <guid>
<format data> ::=
{ binary_data
}
<clock> ::=
CLOCK <b><required><b><clockid>
\r\n
<required> ::= 1
| 0
<clockid> ::= <filter id>
| <class id>
<name> ::= quote_symbol
{ any_non_quote_character
} quote_symbol
<length> ::= unsigned decimal number (as a string), indicating the number
of bytes of data in the following token.
<guid> ::= GUID in string format. for example: {CF49D4E0-1115-11CE-B03A-0020AF0BA770}
<b> ::=
{ space_character
}
{ \t
}
{ \r
}
{ \n
} { <b>
}
<b1> ::= space_character
<id> ::= integer (as a string), such as 0001
在輸出中,每個篩選會有一行新行(“\r\n”),每個連接各一行,每個關鍵詞 FILTER 和 CONNECTIONS 各一行。 彼此的 案例將會是單一空間。 關鍵詞 FILTERS、CONNECTIONS 和 END 無法當地語系化。 另請注意,篩選數據和格式數據是二進位的,因此它們可能包含不正確的換行符、Null 值等等。 數據流會使用寬字元。
下列顯示一般圖表。 (為了清楚起見,連接線已中斷,並省略二進位數據。
003
FILTERS
0001 "C:\SomeFile.avi" {E436EBB5-524F-11CE-9F53-0020AF0BA770} SOURCE "C:\SomeFile.avi" 0000000000
0002 "AVI Splitter" {1B544C20-FD0B-11CE-8C63-00AA0044B51E} 0000000000
0003 "AVI Decompressor" {CF49D4E0-1115-11CE-B03A-0020AF0BA770} 0000000000
0004 "Video Renderer" {70E102B0-5556-11CE-97C0-00AA0055595A} 0000000000
CONNECTIONS
0001 "Output" 0002 "input pin" 0000000288
{E436EB83-524F-11CE-9F53-0020AF0BA770}
{E436EB88-524F-11CE-9F53-0020AF0BA770} 1 0 0000000001
{00000000-0000-0000-0000-000000000000} 0000000000
0002 "Stream 00" 0003 "In" 0000000376
{73646976-0000-0010-8000-00AA00389B71}
{64697663-0000-0010-8000-00AA00389B71} 0 0 0000000001
{05589F80-C356-11CE-BF01-00AA0055595A} 0000000088 <binary data>
0003 "Out" 0004 "In" 0000000376
{73646976-0000-0010-8000-00AA00389B71}
{E436EB7D-524F-11CE-9F53-0020AF0BA770} 1 0 0000129600
{05589F80-C356-11CE-BF01-00AA0055595A} 0000000088 <binary data>
CLOCK 1 0000
END
相關主題
-
使用 GraphEdit 模擬圖形建置