DirectShow
(1)
GraphEdit
(1)
SplitCam
(1)
Contollers
(1)
Dominik
(1)
Lut
(1)
Riseoftheants
(1)
Communicates
(1)
Filter for splitting video input
Asked By dominolog
06-Feb-10 05:57 PM
Hello
I want to write a source filter that can split video in put into
multiple video inputs. By this I mean am example - My filter can
provide the physical USB camera for multiple applications
simultaneously. Normally, only one application can use the USB camera
at once. I have been wondering how to achieve that and I have only
idea to write a DirectShow source filter that capture the video input
(by its internal graph) and provides it via its output pin by some IPC
technique. The other application uses my filter and in its process
instance and my filter communicates with other instance of my filter
that already captures from physical device by transferring frames by
IPC. Is there any easier way to achieve that?
Regards
Is there isome reason the Infinite Pin Tee filter does not work for you?
Jeremy Noring replied to dominolog
06-Feb-10 08:31 PM
Is there isome reason the Infinite Pin Tee filter does not work for you?
http://msdn.microsoft.com/en-us/library/dd390336%28VS.85%29.aspx
I use this filter in my capture graphs to fork a single capture
source. I then typically have a single graph do multiple things,
since it helps a lot with AV sync. So for example, I will capture at
VGA, and then fork that stream with the inf. tee. filter to two other
branches that downsample to QVGA and QQVGA.
From: "Jeremy Noring"I think the OP wants to enable multiple applications
Alessandro Angeli replied to Jeremy Noring
06-Feb-10 09:25 PM
From: "Jeremy Noring"
I think the OP wants to enable multiple applications to
access the same physical device, not multiple filter chains
in the same application.
In that case, the only solution is what the OP envisioned: a
virtual source in each application that uses some IPC
mechanism (e.g. shared memory, a UDP or TCP socket over the
loopback device or a pipe) to fetch the samples from an
out-of-process frame server (e.g. a COM local server or a
system service) that wraps the real source.
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On 7 Lut, 03:25, "Alessandro Angeli" <nob...@nowhere.in.the.
dominolog replied to Alessandro Angeli
07-Feb-10 10:48 AM
On 7 Lut, 03:25, "Alessandro Angeli" <nob...@nowhere.in.the.net>
Hello
Alessandro got my point. I decided to use memory mapped file and
embedd all (client/server) in on filter. The filter builds up its
internal graph when connected and determines whether is he the 1st
instance. If so, it connects to video source and starts splitting (by
writing to memory mapped file). Any further instances of this filter
will realize its role and instead of writing to file, they will read
the video frames from the file. Seems to be simple.
From: "dominolog"That is the easiest way, but not a good one: what happens
Alessandro Angeli replied to dominolog
08-Feb-10 04:00 PM
From: "dominolog"
That is the easiest way, but not a good one: what happens if
the process that created the first instance (the one that
owns the real device) quits?
If you write an out-of-process COM local server or a
service, the system will spawn the process that owns the
real device when needed and will manage its lifetime.
If you like the idea to package it all in a single DLL, you
can still do that: COM will spawn a surrogate process to
turn your in-proc DLL into an out-of-proc EXE and, if you
want a service instead, you can just write an EXE to wrap
the DLL or use SVCHOST.EXE (which is not really documented
however).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
On 8 Lut, 22:00, "Alessandro Angeli" <nob...@nowhere.in.the.
dominolog replied to Alessandro Angeli
17-Feb-10 07:13 AM
On 8 Lut, 22:00, "Alessandro Angeli" <nob...@nowhere.in.the.net>
This is a good hint
Anyway, I will need to implement my IPC mechanism to transfer frames.
Shared memory should be the most efficent and secure way to do it.
Dominik
From: "dominolog"it is not the most secure, but it is the most efficient.
Alessandro Angeli replied to dominolog
17-Feb-10 02:03 PM
From: "dominolog"
it is not the most secure, but it is the most efficient. It
even allows you to do clever things with the sink and source
allocators to avoid copying the samples (but memory copies
are cheap and the added complexity to avoid them is probably
not worth it).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
From: "dominolog"it is not the most secure, but it is the most efficient.
Tom Fisher replied to Alessandro Angeli
04-Nov-10 08:28 PM
I'm using the following webcam splitter app to allow mutiple apps to access the same webcam simultaneously:
http://download.cnet.com/SplitCam/3000-2348_4-10500269.html
When I load the software, it installs a WDM Camera Stream Splitter device driver under Sound Game and Video Contollers which then appears as the first capture device enumerated. When loaded in GraphEdit it appears to be just another capture device. I suspect that it simply outputs whatever video stream that is input
to it and thus to any attached process. Does anyone have any ideas, hints, etc as to how this is accomplished? Memory mapped file, etc, etc?? I would like to be able to input directly to the driver using my own app. It is unfortunate that the author(s) are using it to advertise "adult" sites.
Thanks for any help.
TF