0

I am digging into DirectShow to record video from USB device and from the following code:

hr= m_captureGraphBuilder.SetOutputFileName(MediaSubType.Asf, 
  "E:\\exa.wmv", out pMux, out fSinkFilter);
//
//configure which video setting is used by graph
//                
IConfigAsfWriter2 lConfig = pMux as IConfigAsfWriter2;
Guid asfFilter = new Guid("8C45B4C7-4AEB-4f78-A5EC-88420B9DADEF");
lConfig.ConfigureFilterUsingProfileGuid(asfFilter);
m_captureGraphBuilder.RenderStream(null,null, m_deviceFilter, null, pMux);
m_mediaCtrl = m_graphBuilder as IMediaControl;
m_mediaCtrl.Run();

I am able to record video but it is lowest quality, i am new to directshow and things,

How can I increase quality?

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Rawat
  • 461
  • 3
  • 6
  • 23

1 Answers1

0

The GUID's well-known name is: WMProfile_V80_288VideoOnly, which is:

Windows Media Video 8 for Dial-up Modem (No audio, 28.8 Kbps) -- Use this profile when creating video-only content for target audiences with dial-up modems.

Note that this way to set up encoding is somewhat outdated though still okay:

The profiles listed below all use the version 8 Windows Media Audio and Windows Media Video codecs. There are no predefined system profiles that use the Windows Media 9 Series codecs.

You can alternatively set up encoding profile as MSDN suggests above, or pick a better suitable identifier from the mentioned. The values are available in Windows SDK, or. for instance, here.

See related questions:

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • only one guid works for me and if it works so does it mean that this type of file is in my pc – Rawat Jul 22 '17 at 14:43
  • The likely reason this profile works for you and other don't is that it's video only profile. If you don't supply audio signal, you can apply "no audio" profiles only. – Roman R. Jul 22 '17 at 16:17
  • like if i want to use WMProfile_V80_256Video – Rawat Jul 22 '17 at 18:59
  • WMProfile_V80_256Video is a video+audio profile. You don't have audio, so you need video only profiles, either predefined legacy profiles like you are choosing from, or manually created. Spend some time on studying the documentation, I added some relevant links to the post. – Roman R. Jul 23 '17 at 09:14
  • can i choose the WMProfile_V80_256Video and for audio pin i can set null, is it practical – Rawat Jan 11 '18 at 09:59
  • You can use audio-enabled profile but in this case you must provide data, even if it is a stream of zeros. So you cannot leave audio input unconnected. That is, even though possible it is not what you are actually supposed to do. The best is to not use predefined profiles at all, and instead create a version 9 profile on the fly. The question with code snippet seemingly related: https://stackoverflow.com/q/800179/868014 – Roman R. Jan 11 '18 at 10:07