In this post, we take a quick look at how the VPP H.264 filter can be used using GraphEdit. The H.264 filter accepts both the RGB24 as well as the I420 media types making it compatible with the VPP YUV source filter. The filter can be configured via the property page. Currently, the property page contains the options shown in
Figure 1. More options will be added in the future.
 |
Figure 1 |
At the bottom of the property page, one can tick a checkbox in order to use the standard Microsoft H.264 decoder that comes stock with Windows 7. If the box is unchecked, the VPP decoder will be used, which has a custom media type. Figure 2 shows a graph in which the stock MS H.264 decoder is used to decode the video.
 |
Figure 2 |
Currently, there are two
Modes of Operation that can be selected, mode 0 and mode 1. In mode 0, the
Quality of the video can be configured. Valid values lie in the range [0 - 51] with 0 having the best quality and 51 the worst. Figure 2 shows a graph in which the first encoder has
Quality 0 and the second encoder
Quality 35.
 |
Figure 2 |
Alternatively, the frame bit limit can be set by setting
Mode of Operation equal to 1 which effectively limits the bitrate of the media stream. The frame bit limit is, as the name suggests, measured in bits per frame. That means that to achieve a rate of 128 kb/s with a source video of 10 frames a second, one would need to set the frame bit limit to 12,8 * 1024 = 13107 bits per frame. In a live media pipeline, the VPP Framerate estimator filter may be useful to measure the approximate framerate of the video source.
The other option of interest is the
I-frame Period which creates periodic IDR-frames i.e. every
n-th frame, will be encoded as an IDR frame.
All parameters are programmatically settable by using the COM
ISettingsInterface which all all/most of the VPP DirectShow filters inherit, but that is a post for another day...
P.S. The
Notify on I-frame and
Prepend parameter sets are no longer used and will be removed in the next release of the software.