/// <summary> /// 初始化视频编解码器 /// </summary> /// <param name="bitmapInfo">图像头信息</param> /// <param name="isEncode">标识完成编码还是解码功能</param> public VideoEncoder(BITMAPINFO bitmapInfo, bool isEncode) { this.IsEncode = isEncode; if (isEncode) { COMPVARS compvars = new COMPVARS(); compvars.cbSize = Marshal.SizeOf(compvars); compvars.dwFlags = 1; compvars.fccHandler = FOURCC.MP42; compvars.fccType = FOURCC.ICTYPE_VIDEO; compvars.lDataRate = 780;// 780; compvars.lKey = 15;// 15; compvars.lQ = 500;// -1; //compvars.lQ = 500; this.Compressor = new ICCompressor(compvars, bitmapInfo, FOURCC.MP42); this.Compressor.Open();//打开编码器 } else { bitmapInfo.bmiHeader.biCompression = FOURCC.MP42; this.Decompressor = new ICDecompressor(new COMPVARS(), bitmapInfo, FOURCC.MP42); this.Decompressor.Open(); } }
public ICBase(COMPVARS cp,BITMAPINFO biIn,ICMODE mode,int fourcc) { this.pp=cp; this._in=biIn; this.mode=mode; this.fourcc=fourcc; _out=new BITMAPINFO(); }
static extern int SendMessage( IntPtr hwnd, int wMsg, int wParam, ref BITMAPINFO lParam );
public static extern bool ICSeqCompressFrameStart( COMPVARS pc, ref BITMAPINFO lpbiIn );
//ICMODE_DECOMPRESS /// <summary> /// ��ʼ����Ƶ������ /// </summary> /// <param name="cp">ѹ������</param> /// <param name="biIn">ͼ����Ϣ</param> /// <param name="fourcc">��������</param> public ICDecompressor(COMPVARS cp,BITMAPINFO biIn,int fourcc) : base(cp,biIn,ICMODE.ICMODE_DECOMPRESS,fourcc) { }
public static extern int ICCompressGetFormatSize( int hic, ref BITMAPINFO lpbiInput );
public static extern int ICSendMessage(int hic,int msg,ref BITMAPINFO dw1,ref BITMAPINFO dw2);
/// <summary> /// ³õʼ»¯ÊÓƵ½âÂëÆ÷ /// </summary> /// <param name="cp">ѹËõ¶ÔÏñ</param> /// <param name="biIn">ͼÏñÐÅÏ¢</param> /// <param name="fourcc">±àÂëÀàÐÍ</param> public ICDecompressor(COMPVARS cp, BITMAPINFO biIn, int fourcc) : base(cp, biIn, ICMODE.ICMODE_DECOMPRESS, fourcc) //ICMODE_DECOMPRESS { }
/// <summary> /// ³õʼ»¯ÊÓƵ±àÂëÆ÷ /// </summary> /// <param name="cp">ѹËõ¶ÔÏñ</param> /// <param name="biIn">ͼÏñÐÅÏ¢</param> /// <param name="fourcc">±àÂëÀàÐÍ</param> public ICCompressor(COMPVARS cp, BITMAPINFO biIn, int fourcc) : base(cp, biIn, ICMODE.ICMODE_COMPRESS, fourcc) { }
public static extern int ICSendMessage(int hic, int msg, ref BITMAPINFO dw1, ref BITMAPINFO dw2);