MPG123 DirectShow Filter
Reply #22 – 2005-08-27 08:02:02
Thanks for the reply and have it working no problem. My final question is what, if any, advantage or disadvantage is there of runing mp3123 and mad as a direct show filers as opposed to simplying using the .dll versions of the decoders for winamp in the winamp plugin directory to play mp3s stored locally on the machine? I really only play mp3s stored locally and rarely play streams. It appears that this is designed mainly for decoding audio streams as opposed to decoding .mp3s stored locally on my machine? What does the parser do and what are the purposes of its corresponding settings (how should parser be configured?)? The distinction between filter one and two seems to be debuging versus plain decoding. Please explain. There is probably no advantage in using DirectShow filters to play MP3's in Winamp as opposed to its stock decoder or the .dll plugins (if they are the same version as the ones used to compile the DirectShow filter). You have 2 levels of API versus 1 level of API, so it will probably be slower rather than faster. Streams -- no; Winamp's stock decoder supports streams (at least Shoutcast), and so should the .dll plugins. On the contrary, Winamp's DirectShow plugin is stupid -- it won't play until it can read the entire stream, and with any broadcast, of course this never happens. It will just sit there and consume bandwidth. If you are to play some other type of stream than Shoutcast (e.g. ASF), you would do that in WMP (which will use whatever filter with best merit is in the system to play MP3 data). I'm not sure what happens if you have MP3 data in a QuickTime stream and you open it with QuickTime player, and I don't think Real streams can contain MP3 at all. The advantage of using mpg123/MAD DirectShow filter instead of FhG DirectShow filter is performance, as it was already mentioned. This would concern you if you had some K6-2/300 CPU and wanted to play XviD movies on it, like I did. You would notice that it plays more or less OK without audio (with 70-90% CPU usage), but once you throw in FhG, you hit 100% and the video starts lagging -- so a speedier MP3 decoder helps. And generally, the advantage of having DirectShow plugins is that they can be used in any DirectShow compatible player, not just Winamp. So far as parser and decoder settings are concerned. 1) DirectShow is a stream oriented API; there are always (at least) three parts to playing a file: a) Extracting the data from a file and formatting it in DirectShow format stream. This is done by a parser (also called splitter, or demu(ltiple)xer). No decoding is done at this point, merely the data stored in the file is converted into DirectShow stream(s). b) Decoding the resulting stream(s). This is done by a decoder; a decoder converts MP3, XVID, DIV3, or whatever else gibberish you may have as one of your streams into plain and simple format that your sound/video card can understand. c) Passing the decoded stream(s) to the Windows hardware API (MCI, or DirectX), which in turn pass it to hardware drivers, which pass it to hardware, for playback. For instance, to play an AVI file containing XVID video and MP3 audio, DirectShow would construct the following graph:File Reader | +-> AVI Splitter (a) | +-> XviD MPEG-4 Video Decoder (b) | | | +-> Video Renderer (c) | +-> mpg123 and MAD DirectShow Filter (b) | +-> Default DirectSound Device (c) And to play a plain MP3 file, you will have this:File Reader | +-> MP3 Parser Filter (a) | +-> mpg123 and MAD DirectShow Filter (b) | +-> Default DirectSound Device (c) There is a program called GraphEdit that will help you visualize the process. You can construct graphs manually and connect filters in whatever chain you want so long as input/output stream formats are compatible (which more often than not they won't be even if they are. Ask Microsoft how that is and why you can't connect AVI Splitter to AVI Mux, even though the operations are inverses of one another.) So enabling MP3 parser in mpg123dsf config enables the use of the splitter that is supplied with the package, instead of the default MP3 splitter installed in the system. You don't have to enable the mpg123dsf parser to use mpg123 decoder filter, i.e. you can use the system's default parser with mpg123 decoder. (Doing it the other way around may be tricky, however -- FhG won't connect directly to mpg123dsf parser for reasons unknown to me, so you may need some converter in the middle, or disable features like ReplayGain.) The advantage of mpg123dsf parser over the default system parser is that it can show ID3 tags and pass ReplayGain info to compatible decoders, if hat information is present in the file headers/trailers. So far as Filter 1 and Filter 2 tabs are concerned, these are just two tabs of settings for the same decoder, because they did not all fit in one tab.