ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Audio capture with Media Foundation?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

whisper1980

USA
83 Posts

Posted - Aug 27 2019 :  15:12:44  Show Profile  Reply
I can capture video and audio from my notebook's integrated Webcam with DirectShow (DShow, based on the DirectShow1 demo), but with Media Foundation (MediaFoundationSourceReader), I can capture video to an AVI file but can't for the life of me figure out how to also capture the audio along with it.

Anyone know how to do that or should I stick with DirectShow? I had assumed it might be better to go with MF since I thought it was newer, but perhaps that is not a good reason.

Eric


Eric

xequte

38616 Posts

Posted - Aug 27 2019 :  17:16:37  Show Profile  Reply
Hi Eric

Yes, MMF is newer but it's not as widely used as DirectShow.

Are there no audio streams with your capture:

https://www.imageen.com/help/TIEMediaFoundationSourceReader.StreamCount.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

whisper1980

USA
83 Posts

Posted - Aug 27 2019 :  21:57:43  Show Profile  Reply
That routine returns two streams, both of type "video".

Also, this returns a -1:
i := ImageEnView1.IO.MediaFoundationSourceReader.IndexOfFirstStream(mmf_AUDIO_STREAM);

The DirectShow1 demo shows one video and one audio.
Video input: Integrated Webcam
Audio input: Microphone (Realtek Audio)





Eric
Go to Top of Page

xequte

38616 Posts

Posted - Aug 27 2019 :  22:00:00  Show Profile  Reply
Hi Eric

Perhaps it is best to stick with DirectShow.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

whisper1980

USA
83 Posts

Posted - Aug 27 2019 :  22:29:05  Show Profile  Reply
Thanks for the quick responses. It's strange that MF says both streams are video (only have the one camera). No worries, I'll go with DirectShow.

BTW, I've been using the FFmpeg library (via the free FFVCL version) to convert the huge AVI files into MP4 if anyone is looking for that kind of thing. It works quite well and I've integrated the options internally so it will be transparent to the user (i.e. not needing to use FFVCL's sample dialogs). Are you planning on providing AVI conversion features of your own? Perhaps you already have and I overlooked it?

Eric
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: