View Full Version : Reading MP2-Audio
WarpEnterprises
22nd August 2002, 08:40
My goal is to open an MP2-audio-stream in AviSynth, but I didn't find a method (to open mpeg2-video via mpeg(2)source, AudioDub the soundtrack and then trim, ... both)
This is what I already read and found:
1. It is no problem to add a RIFF/WAV-header to a mp2-file (the same as the well-known mp3-case), e.g. with the program WaveMP3
2. This WAV can be opened e.g. in TMPG (it seems via DirectShow), but not in AviSynth (error: ACM failed to suggest a compatible PCM format) - I have no ACM mp2 codec installed
3. The only ACM mp2-DEcoder that I could hear of is from QDesign, but it seems to be no longer available (and of course not free). I didn't succeed in finding any copy of it.
4. VirtualDub can open mpeg1-Video-files + the sound track inside, so there must be the code to handle it.
Please help!
Belgabor
22nd August 2002, 09:49
Have you tried DirectShowSource()?
Cheers
Belgabor
WarpEnterprises
22nd August 2002, 10:36
AFAIK DirectShowSource doesn't support audio (and it really doesn't work. (ErrMsg: the filter graph manager won't talk to me)
:(
vinetu
22nd August 2002, 13:12
(ErrMsg: the filter graph manager won't talk to me)
this is in case of PowerDVD(clvsd.ax) on my winXP,but
WinDVD and Elecard filters work for video (don't no for audio)
dividee
22nd August 2002, 13:57
DirectShowSource won't do audio, no matter what you try.
This source filter is quite limited; I'd like to be able to open GRF files and have audio support. Unfortunately I don't know anything about DirectShow, so I probably won't tackle the problem anytime soon.
It would be great if some DirectShow developer could do it. :devil:
WarpEnterprises
23rd August 2002, 09:00
@dividee: I didn't meant to use DirectShow, but the same mechanism that works for waved mp3 (ACM) or VD uses to read mp2.
Do you know the reason that there is not a single ACM-mp2 codec (besides that dubious qdesign)?
sh0dan
23rd August 2002, 11:00
Adding mpg-lib as Source-filter would be a nice plugin.
Sven72
16th October 2002, 14:49
Warp,
have you made any progress on this issue? I was following it with quite some interest. The big advantage for me would be to directly transcode the AC3 to MP2, "wav-heading" it and feeding it via AviSynth to my favourite application ..
Thanks for any feedback,
Sven
WarpEnterprises
17th October 2002, 17:27
I tested the qdesign ACM codec. It works in principle (reading waved mp2), but it crashes too easily.
So the only way seems to wait on a native avisynth tool.
( :( )
DSPguru
18th October 2002, 19:34
how about creating a BeSynth plugin out of BeSweet.dll ?
sh0dan
18th October 2002, 21:02
Using besweet as an input _and_ output module would be the best thing that happened to AviSynth since the first D2V reader was made!
I've currently held back on contacting you. As you might remember, we talked about upgrading AviSynth to support multiple channels and float samples. Well, now it's about there!
I'm readying up for the first AviSynth 2.5 alpha now. Primary aimed at developers.
I'm writing developer documentation, for people who would like to support the new features (being a 90% new sample engine and YV12 planar image support as the most obvious).
I hope you'd like to consider making BeSweet a plugin. It would be perfect for the new multichannel / float engine. You'd even be able to keep the commandline parsing mostly as it is, since AviSynth could just provide a string with your settings.
DSPguru
18th October 2002, 21:13
BeSweet.dll, as it is now, isn't very far from fitting AviSynth.
input
BeSweet.dll already have the following exported functions :
MPA_Bursts,PCM_Bursts,AC3_Bursts. (an asyhchronous interface where you feed BeSweet with variable-length audio bitrstreams).
output
imho, all is needed is the ability to set few (probably two) callback functions :
- one for replacing BeSweet's fwrite's (so BeSynth could be used as an encoder).
- one for replacing BeSweet's output's (so BeSynth could be used as a decoder).
as you probably know, my spare time is very limited, and therefore it would be much better if someone had lead the developing of this plugin, and i would be his "assister".
Nic
21st October 2002, 12:05
Well im going to give up on my project of MPEGDecoder.dll :( it's a dead duck pretty much & I dont have the time to work on a big project. little graphical glitches etc I dont have the time to work on & find :(
(it was worth a try, maybe ill be made unemployed one day & Ill be able to work on it...)
But seeing ive used BeSweet.dll before & made an AviSynth plugin, ill try & churn something out which will at least do AC3 by the end of this week....
Cheers,
-Nic
ps
Once ive done that, the code for MP2/MP3 would be the same. But Im not sure if either myself or Dg have got round to testing it yet :)
sh0dan
21st October 2002, 12:30
Have a look at the AviSynth 2.5 alpha. It contains a much better sound handling, and supports multiple channels.
Also the sound part of the alpha is almost mature, with 95% of all filters converted.
Nic
21st October 2002, 13:39
Great work sh0dan ill check it out :)
Im guessing ill just hack a version of WavSource for now to take AC3 files & output to two channel. With my lack of time thats as far as ill probably get this week :( , but ill release the source as I go so people can pick it up when I slow down.
-Nic
ps
Im forgetting of course that WavSource is the same as AviSource...(not that it matters)
pps
Does AviSynth still support non-floating point samples? Im assuming so, but ill check the source now...
sh0dan
21st October 2002, 13:50
AviSource is not the same as WavSource anymore, since the addition of compressed audio support, but AC3 AVI's are properly decoded as 5 channel audio in the AviSynth 2.5 alpha.
Doing AC3 decoding would probably be best as an external plugin, but if you get it up and running it should be a small matter to convert it.
My point about using 2.5 is that sound handling has been changed quite a lot, so it would perhaps be easier for you to use 2.5.
WarpEnterprises
28th November 2002, 23:24
Some news about reading mp2 with AviSynth via ACM (qmpeg).
After doing some comparisons between orginal-qmpeg-MP2-WAVs and waved MP2 I found out that some info (bitrate, align) was missing in the header.
With the program MPA2WAV (Steve Lhomme) which is available as source code I could make the necessary mods to get it
PERFECTLY WORKING
(only in AviSynth - don't know why the files don't play completely proper in WMP)
The modified version is HERE (http://members.aon.at/archi/wepictures/mpa2wav.zip)
of course you have to get qmpeg.acm first TsunFilPak :)
Wilbert
6th December 2002, 11:08
Can you mail me this file (qmpeg.acm)? (w.j.dijkhof@tue.nl)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.