All source code provided on this web site is distribured according to the following BSD-style license.
However, you are allowed to exclude clause 3 if and only if you redistribute the source or binary code under the GPL version
2.0 (see here)
or 3.0 (see here).
Copyright (c) 2010, Alessandro Angeli All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Alessandro Angeli. 4. Neither the name of Alessandro Angeli nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY ALESSANDRO ANGELI ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ALESSANDRO ANGELI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Using ACM to convert between MP3 and PCM
Explained here.
Explained here with source code in C (the source code the article refers to is available here). How to port the tables in the C source code to C# here is explained here.
WMP can play an MP3 file while a DirectShow application can't or viceversa
WMP handles MP3 files differently as explained here and here. This long and very technical thread explains the internals of ASF reading in WMP7+, which is the same way WMP7+ reads MP3.
WMP can't play an ASF using a third-party codec even if a DirectShow decoder is installed
This long and very technical thread explains the internals of ASF reading in WMP7+ and why only DMO or VCM/ACM decoders work.
Explained here with sample code in C# and VB.NET.
The GRF syntax is documented here. Full GRF parser in C here. A GRF file is a COM structured storage file, akso known as docfile, and the structured storage API is documented here.
How to manually load a VCM codec's DLL
Explained here.
How to spy on another application's internal graph
This long and very technical thread explains how to spy on another application's internal graph using an API hooking mechanism.
How to capture the contents of an overlay surface owned by another application
Explained here.
The easy way here. The hard but far more flexible way in C is here.
This long and very technical thread explains how to set up an API hooking mechanism.
How to use API hooking without Detours
Explained here.
How to write a filter to push data synchronously into a graph from memory
Explained here.
How to display a filter's property pages
Explained here.
How to programmatically configure a filter through its property pages
Explained here (including sample C++ code).
Listed here.
Sample MJPEG push source + Sample MJPEG extractor
These 2 samples show several things:
The solution files are for VisualStudio 2005. VisualStudio 2005 SP1 + Windows SDK 6.x for Vista/Win2008 is recommended. The "mjpeg2jpeg\dxtrans.h" file is required to work around the missing dxtrans.h in the DirectX SDK (versions newer than August 2007), which is required by qedit.h. To complile the samples, you need to put a copy of the BaseClasses's folder in the samples' solution folder. Unless you modify the code,
The included AviSynth script can be used to generate such a sequence where each frame contains a scrolling frame number (which makes debugging much easier): install AviSynth and VirtualDub, open the AVS in VirtualDub and use {File -> Save image sequence} to save the generated frames (prefix="", suffix=".jpg", digits=3), then convert the sequence to JPEG using your favorite batch image converter (e.g. IrfanView). You can use the AVS to generate the source AVI as well: in GraphEdit, add the DiretShowFilters\AVIWAVFileSource, opening the AVS, then connect the video output to the VideoCompressors\MJPEGCompressor, then to the DiretShowFilters\AVIMux and finally to the DiretShowFilters\FileWriter, saving the AVI, then run the graph.
How to extract valid JPEGs from an MJPEG stream is explained here.
Thanks to "Jon E" for pointing out the ERROR_NOT_FOUND vs. ERROR_FILE_NOT_FOUND bug.
Sample ASF/WMV mux filter for DirectShow
This sample shows several things:
The solution file is for VisualStudio 2008. VisualStudio 2008 SP1 + Windows SDK 7.0 for Win7 is recommended. To complile the samples, you need to put a copy of the BaseClasses's folder in the samples' solution folder. Unless you modify the code, the test main() accepts a variable number of arguments: the first is the output WMV file and the rest are 1 or more input files. The format of the input files must be supported by DirectShow and the contained audio/video stream must be compatible with AVI (that is, VIDEOINFOHEADER for video and WAVEFORMATEX for audio).
"babgvant" published a DVR-MS to WMV remuxer based on this code which you can get here.
Sample ASF remuxer that can remux a source ASF into a sequence of smaller ASF files
This sample shows several things:
The solution file is for VisualStudio 2005. VisualStudio 2005 SP1 + Windows SDK 6.x for Vista/Win2008 is recommended.
Unless you modify the code, the test main() accepts the following arguments:
<source> <target> <ext> <first> <digits>
- source
[string] source URL or file
- target
[string] target file base path
- ext
[string] target file ext (including the leading ".")
- first
[int] first target file index
- digits
[int] min number of digits in target file index
The segments will be named as in printf("%s%0*d%s",target,digits,first,ext)
.