DirectShowLib里的例子turner,只有实时显示图像,和录视频。请问怎样在录像文件里加上音频,实时里也播放

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);//我加的 

慕姐8265434
浏览 2911回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP