0

I want to generate .mp4 file using Direct show samples (AMCap). But i don't know how to implement this. Can anyone please help me about this?

Thanks in advance, Dhaval Kariya

Dhaval Kariya
  • 59
  • 2
  • 8

1 Answers1

2

AMCap Sample captures and displays video. No encoding and choices of multiplexing into files (only basic capture/recording through a basically obsolete helper interface).

Video capture application.

This sample application demonstrates the following tasks related to audio and video capture:

  • Capture to a file
  • Live preview
  • Allocation of the capture file
  • Display of device property pages
  • Device enumeration
  • Stream control

The items above might be confusing as they mention capture and file allocation. This is a trail of 15 years old history when file capture was a big deal. The helper object to initialize capture targets AVI and ASF/WMV only, you neither can extend it to support other formats, nor you need to.

You need to check how to store video/audio into files (see below) and follow the same steps in building the pipeline with MPEG-4 encoders and multiplexer. You will need to use a third party MPEG-4 multiplexer for MP4 file format because Windows does not provide you with such out-of-the-box usable component.

See:

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Hey, thanks Roman for your reply. I have looked into http://www.gdcl.co.uk/mpeg4/ and downloaded the source as well as dll files. I am beginner of video capture and vc++ programming. I don't know how to use MP4 mux and demux with AMCap Sample. so can you please give me a sample code with bit description. Thanks in advance, Dhaval Kariya – Dhaval Kariya Apr 18 '12 at 15:00
  • I suggest that you make yourself familiar with GraphEdit tool in Windows SDK. It is described on MSDN here http://msdn.microsoft.com/en-us/library/windows/desktop/dd407274%28v=vs.85%29.aspx You can build DirectShow graphs interactively, and you then will do a similar thing in software. You will be able to see how to attach MP4 mux to the data being captured live. – Roman R. Apr 19 '12 at 21:26
  • Thank You Roman. I finally got bit knowledge to use GraphEdit tool. – Dhaval Kariya May 07 '12 at 08:15