简体   繁体   English

无法使用Windows媒体编码器录制基于比特率的音频

[英]Cannot record Bitrate-based audio using Windows media encoder

I want to record video from webcam and sound from microphone using Windows Media Encoder. 我想使用Windows Media Encoder录制网络摄像头的视频和麦克风的声音。 I set a profile to record audio using bitrate-based mode and video using CBR. 我设置了一个配置文件,以使用基于比特率的模式录制音频,并使用CBR录制视频。

 this.newProfile = new WMEncProfile2();
            this.newProfile.ValidateMode = true;

            this.newProfile.ContentType = 17;
            this.newProfile.set_VBRMode(WMENC_SOURCE_TYPE.WMENC_AUDIO, 0, WMENC_PROFILE_VBR_MODE.WMENC_PVM_BITRATE_BASED);
            this.newProfile.set_VBRMode(WMENC_SOURCE_TYPE.WMENC_VIDEO, 0, WMENC_PROFILE_VBR_MODE.WMENC_PVM_NONE);
            newProfile.AddAudience(400000);
            IWMEncAudienceObj audience = newProfile.get_Audience(0);
            audience.set_VideoCodec(0, 3);
            audience.set_VideoBitrate(0, 700000);
            audience.set_VideoFPS(0, 25000);
            audience.set_VideoKeyFrameDistance(0, 5000);
            audience.set_VideoBufferSize(0, 3000);
            audience.set_VideoWidth(0,800);
            audience.set_VideoHeight(0, 600);
            audience.set_AudioCodec(0, 1);
            audience.SetAudioConfig(0, 2, 44100, 192000, 16);
            this.newProfile.Validate();

However, the video output has no sound. 但是,视频输出没有声音。 It's just work in CBR mode. 它仅在CBR模式下工作。

I just konw that Bitrate-based VBR, encoder must start(encoder.Start();) twice. 我只是知道基于比特率的VBR,编码器必须两次启动(encoder.Start();)。 Now, I can record the sound. 现在,我可以录制声音了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM