Webcam capture with Microsoft Media Foundation

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
rommmcek
Posts: 1473
Joined: 15 Aug 2014, 15:18

Re: Webcam capture with Microsoft Media Foundation (Win10)

06 Jan 2020, 16:33

Cam alone o.k., with audio:
IMFSourceReader_SetCurrentMediaType error: -1072875852
ErrorLevel: 0
guest3456
Posts: 3462
Joined: 09 Oct 2013, 10:31

Re: Webcam capture with Microsoft Media Foundation (Win10)

06 Jan 2020, 19:58

malcev wrote:
06 Jan 2020, 15:18
What value shows this code?
https://pastebin.com/eeBJF2ub
one messagebox with 0x3 for me

malcev wrote:
06 Jan 2020, 13:46
guest3456, rommmcek please test now.
I tested on 2 notebooks, HP and Asus - it works.
running the latest code in the top post, now i get:

IMFSourceReader_SetCurrentMediaType error: -1072875852
ErrorLevel: 0

on a Lenovo Thinkpad

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Webcam capture with Microsoft Media Foundation (Win10)

07 Jan 2020, 10:35

I updated source code.
Now it enumerates all streams from camcorder, enumerates each type of each stream and choose the best for h.264 and aac encoding (not 100% shure about this).
User avatar
rommmcek
Posts: 1473
Joined: 15 Aug 2014, 15:18

Re: Webcam capture with Microsoft Media Foundation (Win10)

07 Jan 2020, 10:56

On Lenovo IdeaPad Y580 works flawless! Great work!
guest3456
Posts: 3462
Joined: 09 Oct 2013, 10:31

Re: Webcam capture with Microsoft Media Foundation (Win10)

07 Jan 2020, 12:06

malcev wrote:
07 Jan 2020, 10:35
I updated source code.
Now it enumerates all streams from camcorder, enumerates each type of each stream and choose the best for h.264 and aac encoding (not 100% shure about this).
now it works for me too, both audio and video. great work

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Webcam capture with Microsoft Media Foundation

21 Jan 2020, 05:34

Add support for Windows 7.
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Webcam capture with Microsoft Media Foundation

25 Jan 2020, 19:50

Add support for preview window with Direct2D help.
User avatar
rommmcek
Posts: 1473
Joined: 15 Aug 2014, 15:18

Re: Webcam capture with Microsoft Media Foundation

09 Feb 2020, 15:41

Couple of tests for version from 08. Feb. 2020: Recordings of 5, 10 and 60 sec with preview width 400 and full (commented), all were correct on Win10.

Great job continues!!!
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Webcam capture with Microsoft Media Foundation

15 Feb 2020, 07:39

Thanks for test.
I update code
1) add quotes when show all devices, because it can be devices with space at the end of name.
2) add support for enumerating devices with the same name.
3) add support for different Video Input Types with Color Converter DSP help.
https://docs.microsoft.com/en-us/windows/win32/medfound/colorconverter
robodesign
Posts: 934
Joined: 30 Sep 2017, 03:59
Location: Romania
Contact:

Re: Webcam capture with Microsoft Media Foundation

15 Feb 2020, 08:25

This is lovely.

Can this be adapted to acquire images from a scanner?

Best regards, Marius
-------------------------
KeyPress OSD v4: GitHub or forum. (presentation video)
Quick Picto Viewer: GitHub or forum.
AHK GDI+ expanded / compilation library (on GitHub)
My home page.
User avatar
rommmcek
Posts: 1473
Joined: 15 Aug 2014, 15:18

Re: Webcam capture with Microsoft Media Foundation

15 Feb 2020, 09:06

robodesign wrote:
15 Feb 2020, 08:25
Can this be adapted to acquire images from a scanner?
Take a look in this thread!

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Google [Bot], jchestnut and 71 guests