wm asf writer默认使用的是v8的系统Profile,他的视频大小都是 320 x 240这么大小的。可以通过IConfigAsfWriter::GetCurrentProfile获得Profile对象,然后按你的要求修改,正如你描述的那样。(你为什么不按你的想法试一下,如果碰到问题再把问题贴出来。)
另外一个办法,就是使用windows media format sdk自己来创建一个profile,然后通过wm asf writer的IConfigAsfWriter::ConfigureFilterUsingProfile设置,这种方式可以使用最新的9系列的编解码器(系统Profile只能使用v8的编解码器)。
下面是IWMStreamConfig接口的所有函数,我只看到如何调整bitrate,但是那个函数使用调整视频流的图像的高度和宽度啊,老大,继续指示
Method Description
GetBitrate Retrieves the bit rate for the stream.
GetBufferWindow Retrieves the maximum latency between when a stream is received and when it begins to be displayed.
GetConnectionName Retrieves the connection name given to the stream.
GetStreamName Retrieves the stream name.
GetStreamNumber Retrieves the stream number.
GetStreamType Retrieves the major type of the stream (audio, video, or script).
SetBitrate Specifies the bit rate for the stream.
SetBufferWindow Specifies the maximum latency between when a stream is received and when it begins to be displayed.
SetConnectionName Specifies the connection name given to a stream.
SetStreamName Specifies the stream name.
SetStreamNumber Specifies the stream number.
typedef struct tagVIDEOINFOHEADER {
RECT rcSource,
RECT rcTarget;
DWORD dwBitRate;
DWORD dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
BITMAPINFOHEADER bmiHeader;
} VIDEOINFOHEADER;
因为我看到BITMAPINFOHEADER 结构有两个成员
LONG biWidth;
LONG biHeight;
不知道是否通过这bmiHeader的两个变量来设置视频的宽度和高度,???
另:我通过查看GetMediaType返回的媒体类型,发现biWidth和 biHeight都是零?怎么解释啊?
还请陆兄再次指教
附:BITMAPINFOHEADER结构
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER;