> I'm working on a proof of concept. We have 20 seconds of
> captured mpeg data from a camera. This data is strored in
> a database in raw binary format. We are hoping to use
> media player to display this mpeg data back to the user
> but haven't been able to find any samples of how to push
> raw data to Windows Media player. We can find lots of
> samples regarding individual files. Ideally, we would
> like to stream this data from our database to a media
> player client.
>
> Is this something that is possible to do with media
> player? Logicially, it seems like it can be done but I'm
> having some trouble locating the resources to guide me.
You need to write a source filter for DirectShow. A better
place to ask questions about DS is
<microsoft.public.win32.programmer.directx.video>.
DS source filters can be of 2 types: push sources or pull
sources, aka async readers.
The stock MPEG-1 splitter, which supports MPEG-1 system and
(packetized) elementary streams, expects an async reader and
so does the stock MPEG-2 one, which supports MPEG-2 program
streams. The stock MPEG-2 demuxer (only available on XP and
newer OS editions) expects an async reader for MPEG-2
program streams and a push source for MPEG-2 transport
streams. So, depending on what kind of MPEG stream you have,
you need to either create an async reader or a push source
or write your own MPEG parser.
Notice that reading from a DB is typically a sequential
operation while async readers need to support random access,
thus writing an async reader may be a bit complicated (the
stock URLReader for example solves this by caching the
stream to disk if needed, but it annoying if the stream
takes some time to be downloaded and it has security
issues). However, the stock MPEG splitter may not use the
random access feature, in which case you would be lucky (you
need to try, because I don't remember whether the read the
stream sequentially or not).
The DS SDK is part of the latest Platform/Windows SDK (the
Vista or 2003R2 versions are fine for older OS versions as
well) and includes tutorials on how to write an register
source filters, documentation on the stock MPEG-1/2 parsers,
BaseClasses to help you write filters and samples that use
the BaseClasses of push sources (the Push and Ball samples)
and async readers (the Async sample, which also contains an
additional base class to write async readers).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Thanks so much for the info. I'll refer to the other newsgroup but this
should get me headed off in the right direction.
Gary