DirectShowLib里的例子turner,只有实时显示图像,和录视频。请问怎样在录像文件里加上音频,实时里也播放声音。?谢谢!
我加了音频压缩连到输出文件 部分,但程序死机了。
//Create the file writer part of the graph. SetOutputFileName does this for us, and returns the mux and sink IBaseFilter mux; IFileSinkFilter sink; hr = captureGraphBuilder.SetOutputFileName(MediaSubType.Avi, get_SaveFileName(), out mux, out sink);//textBox1.Text DsError.ThrowExceptionForHR(hr);
//Connect the device and compressor to the mux to render the capture part of the graph hr = captureGraphBuilder.RenderStream(PinCategory.Capture, MediaType.Video, theDevice, theCompressor, mux);// DsError.ThrowExceptionForHR(hr);
hr = captureGraphBuilder.RenderStream(PinCategory.Capture, MediaType.Audio, theDevice, theCompressor_A, mux);//我加的 DsError.ThrowExceptionForHR(hr);//我加的
2 回答
- 2 回答
- 0 关注
- 2910 浏览
添加回答
举报
0/150
提交
取消