Discussion:
Which technology?
(too old to reply)
Todor Todorov
2010-02-16 17:09:22 UTC
Permalink
I need to implement features in an existing app to:
- Play as many audio and video file types as possible.
- For audio files, create a waveform preview (possibly without playing the
file, i.e. having to listen to it and wait until it finishes).
- For video files, create a waveform and picture snapshots preview.
- If possible, play any multimedia file that Windows has codec for.
- Be compatible from Windows XP and up.
- Use a Windows API (C/C++/COM - no .Net).

My first idea was to use DirectX (DirectSound, DirectShow etc.), but not
every DirectX technology is available on XP. Some (DirectSound, XAudio2,
XACT etc.), if I understood correctly the Windows SDK and DirectX SDK, if
available on XP, are not recommended for my type of application.

Can you please recommend which MS technologies are best for my needs.

Thanks!
Alessandro Angeli
2010-02-16 20:50:49 UTC
Permalink
From: "Todor Todorov"
Post by Todor Todorov
My first idea was to use DirectX (DirectSound, DirectShow
etc.), but not every DirectX technology is available on
XP.
On the other hand, what is available on XP is also available
on newer Windows versions and it is more than enough.
Post by Todor Todorov
Some (DirectSound, XAudio2, XACT etc.), if I
understood correctly the Windows SDK and DirectX SDK, if
available on XP, are not recommended for my type of
application.
Those are low-level components for audio and video
rendering, not multimedia frameworks.
Post by Todor Todorov
Can you please recommend which MS technologies are best
for my needs.
There is only one Microsoft framework you can use and that
is DirectShow which, despite the name, is not part of
DirectX.

DS is what is used by WindowsMediaPlayer so it supports
every format that WMP supports (a few more actually).

There are also non-Microsoft frameworks out there, like the
open-source GStreamer (if you can cope with the licensing)
or the commercial QuickTime for Windows (but I wouldn't
recomment it over DirectShow).
Post by Todor Todorov
- For audio files, create a waveform preview (possibly
without playing the file, i.e. having to listen to it and
wait until it finishes). - For video files, create a
waveform and picture
snapshots preview.
Both simply require that you replace the renderers with the
SampleGrabber + NullRenderer and remove the clock (to run
the graph as fast as possible. Than you can run the graph
and grab the samples you need to display the waveform and
the thumbnails.
Post by Todor Todorov
- Play as many audio and video file types as possible.
- If possible, play any multimedia file that Windows has
codec for.
That's what DirectShow was designed for.
Post by Todor Todorov
- Be compatible from Windows XP and up.
DirectShow has been there since Win98.
Post by Todor Todorov
- Use a Windows API (C/C++/COM - no .Net).
DirectShow's API is only available for C++ (barring a
limited COM/OLE/ActiveX/VB automation-compatible subset and
third-party .NET wrappers).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Todor Todorov
2010-02-17 21:13:27 UTC
Permalink
Thanks for the reply. It's not easy to navigate the jungle of Microsoft
technologies. DirectShow (confusing name) seams to be the thing I am looking
for.
Post by Alessandro Angeli
From: "Todor Todorov"
Post by Todor Todorov
My first idea was to use DirectX (DirectSound, DirectShow
etc.), but not every DirectX technology is available on
XP.
On the other hand, what is available on XP is also available on newer
Windows versions and it is more than enough.
Post by Todor Todorov
Some (DirectSound, XAudio2, XACT etc.), if I
understood correctly the Windows SDK and DirectX SDK, if
available on XP, are not recommended for my type of
application.
Those are low-level components for audio and video rendering, not
multimedia frameworks.
Post by Todor Todorov
Can you please recommend which MS technologies are best
for my needs.
There is only one Microsoft framework you can use and that is DirectShow
which, despite the name, is not part of DirectX.
DS is what is used by WindowsMediaPlayer so it supports every format that
WMP supports (a few more actually).
There are also non-Microsoft frameworks out there, like the open-source
GStreamer (if you can cope with the licensing) or the commercial QuickTime
for Windows (but I wouldn't recomment it over DirectShow).
Post by Todor Todorov
- For audio files, create a waveform preview (possibly
without playing the file, i.e. having to listen to it and
wait until it finishes). - For video files, create a waveform and picture
snapshots preview.
Both simply require that you replace the renderers with the SampleGrabber
+ NullRenderer and remove the clock (to run the graph as fast as possible.
Than you can run the graph and grab the samples you need to display the
waveform and the thumbnails.
Post by Todor Todorov
- Play as many audio and video file types as possible.
- If possible, play any multimedia file that Windows has
codec for.
That's what DirectShow was designed for.
Post by Todor Todorov
- Be compatible from Windows XP and up.
DirectShow has been there since Win98.
Post by Todor Todorov
- Use a Windows API (C/C++/COM - no .Net).
DirectShow's API is only available for C++ (barring a limited
COM/OLE/ActiveX/VB automation-compatible subset and third-party .NET
wrappers).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Todor Todorov
2010-02-18 15:34:04 UTC
Permalink
BTW, do you know how to handle DRM protected files? I don't need the raw
data, but just a "preview", so I can create a navigation interface to the
end-user?

Thanks!
Post by Todor Todorov
Thanks for the reply. It's not easy to navigate the jungle of Microsoft
technologies. DirectShow (confusing name) seams to be the thing I am
looking for.
Post by Alessandro Angeli
From: "Todor Todorov"
Post by Todor Todorov
My first idea was to use DirectX (DirectSound, DirectShow
etc.), but not every DirectX technology is available on
XP.
On the other hand, what is available on XP is also available on newer
Windows versions and it is more than enough.
Post by Todor Todorov
Some (DirectSound, XAudio2, XACT etc.), if I
understood correctly the Windows SDK and DirectX SDK, if
available on XP, are not recommended for my type of
application.
Those are low-level components for audio and video rendering, not
multimedia frameworks.
Post by Todor Todorov
Can you please recommend which MS technologies are best
for my needs.
There is only one Microsoft framework you can use and that is DirectShow
which, despite the name, is not part of DirectX.
DS is what is used by WindowsMediaPlayer so it supports every format that
WMP supports (a few more actually).
There are also non-Microsoft frameworks out there, like the open-source
GStreamer (if you can cope with the licensing) or the commercial
QuickTime for Windows (but I wouldn't recomment it over DirectShow).
Post by Todor Todorov
- For audio files, create a waveform preview (possibly
without playing the file, i.e. having to listen to it and
wait until it finishes). - For video files, create a waveform and picture
snapshots preview.
Both simply require that you replace the renderers with the SampleGrabber
+ NullRenderer and remove the clock (to run the graph as fast as
possible. Than you can run the graph and grab the samples you need to
display the waveform and the thumbnails.
Post by Todor Todorov
- Play as many audio and video file types as possible.
- If possible, play any multimedia file that Windows has
codec for.
That's what DirectShow was designed for.
Post by Todor Todorov
- Be compatible from Windows XP and up.
DirectShow has been there since Win98.
Post by Todor Todorov
- Use a Windows API (C/C++/COM - no .Net).
DirectShow's API is only available for C++ (barring a limited
COM/OLE/ActiveX/VB automation-compatible subset and third-party .NET
wrappers).
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Alessandro Angeli
2010-02-18 18:18:06 UTC
Permalink
From: "Todor Todorov"
Post by Todor Todorov
BTW, do you know how to handle DRM protected files? I
don't need the raw data, but just a "preview", so I can
create a navigation interface to the end-user?
There is no standard way, it depends on what DRM framework
we are talking about. If you mean WindowsMedia DRM for
WindowsMedia files, you should be able to read them just
like any other WM file, but you will only receive
decompressed data (which is what you want anyway).

In more detail, to read DRM'ed and non-DRM'ed WM files in
DirectShow, you should do the following (in pseudo-C++):

LPCWSTR szFileURL;
bool zDRM = WMIsContentProtected(szFileURL);
IGraphBuilder* pGrfBuilder =
CoCreateInstance(CLSID_FilterGraph,NULL,
CLSCTX_INPROC_SERVER,__uuidof(IGraphBuilder));
IBaseFilter* pAsfFilter =
CoCreateInstance(CLSID_WMAsfReader,NULL,NULL,
CLSCTX_INPROC_SERVER,__uuidof(IBaseFilter));
pGrfBuilder->AddFilter(pAsfFilter );
IFileSourceFilter* pAsfSource =
pAsfFilter->QueryInterface(__uuidof(IFileSourceFilter));
pAsfSource->Load(szFileURL,NULL);
pAsfSource->Release();
if(zDRM) {
IServiceProvider* pAsfService =
pAsfFilter->QueryInterface(__uuidof(IServiceProvider));
IWMDRMReader* pDrmReader =
pAsfService->QueryService(__uuidof(IWMDRMReader),
__uuidof(IWMDRMReader));
pAsfService->Release();
/// use pDrmReader to handle the DRM license acquisition
pDrmReader->Release();
}
IEnumPins* pAsfPins = pAsfFilter->EnumPins();
IPin* pAsfPin;
while(S_OK == pAsfPins->Next(1,&pAsfPin,NULL)) {
pGrfBuilder->Render(pAsfPin);
pAsfPin->Release();
}
pAsfPins->Release();
/// use the graph
pGrfBuilder->Release();
--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
Continue reading on narkive:
Loading...