全部博文(20)
分类: WINDOWS
2009-10-12 17:41:47
The Stream Buffer Engine enables an application to seek, pause, and record a live video stream without interrupting the stream. Transitions between live and recorded content are seamless. Currently, the Stream Buffer Engine supports MPEG-2 video and digital video (DV) sources, at capture rates up to 20 megabits per second (Mbps).
Applications can use the Stream Buffer Engine to provide VCR-like functions, such as pause, seek, and multi-speed play ("trick mode"), while rendering a live video stream. Applications can also use the Stream Buffer Engine to record video for later playback.
The Stream Buffer Engine uses two or more independent filter graphs. One filter graph, called the sink graph, captures data from a live source. The other graphs, called source graphs, render the data. Using several filter graphs is more flexible and scalable than using a single graph for both capture and rendering. The sink graph stores the data in a temporary buffer or in permanent files, while the source graphs read the data from those files. Several source graphs can read data from the same sink source.
A source graph can:
The Stream Buffer Engine uses multiple filter graphs:
The sink graph can also create permanent recordings, which can be viewed later using the Stream Buffer Source filter. Currently, the Stream Buffer Engine supports MPEG-2 video and digital video (DV) sources. The source graph must be on the same computer as the sink graph; the source graph cannot read the backing files over a network.
The Stream Buffer Sink filter stores the data that it captures in temporary backing files. By default, it uses six files, each holding 5 minutes of data, for a total buffer of 30 minutes. (The default settings can be changed through the interface.)
Once the buffer limit is reached, the Stream Buffer Sink filter begins to delete files, starting from the oldest file. If a source graph is currently reading from that file, the sink filter deletes the next oldest file instead, creating a "time hole" in the playback. Time holes are caused when the source graph pauses for too long or seeks backward to the beginning of the buffer.
When the Stream Buffer Source filter reaches the gap where the file was deleted, it moves to the next file. However, because the presentation times haven't changed, the last frame from the older file is displayed for the duration of the deleted file. The video therefore appears to freeze for that period of time. To avoid this, the source graph should seek forward to the next valid data.