|
本帖最后由 佰锐科技-李永星 于 2015-12-16 17:03 编辑
您好,稍等,我来写个demo,参考如下:- AnyChatCoreSDK.SetVideoDataCallBack(AnyChatCoreSDK.PixelFormat.BRAC_PIX_FMT_YUV420P, video_Callback, hWnd.ToInt32());
复制代码- private static void VideoData_CallBack(int userId, IntPtr buf, int len, AnyChatCoreSDK.BITMAPINFOHEADER bitMap, int userValue)
- {
- if (userId == UserID) //保存指定用户ID的YUV数据
- {
- DateTime time = DateTime.Now;
- FileStream fs = new FileStream("test.yuv", FileMode.Append);
- BinaryWriter wt = new BinaryWriter(fs);
- byte[] wtBuff = new byte[len];
- Marshal.Copy(buf, wtBuff, 0, len);
- wt.Write(wtBuff);
- wt.Close();
- fs.Close();
- TimeSpan span = DateTime.Now.Subtract(time);
- Console.Out.WriteLine(span.TotalMilliseconds);
- }
- }
复制代码 |
|