PDA

View Full Version : Can mp2 be used in AVIs?


dinston
11th April 2002, 16:51
This seems such a basic question, but I've
never seen it addressed. When converting
(S)VCD to divx, it would seem logical to use
the original MP2 at 224kbps, but I have found
no way of muxing MP2 in AVIs. This certainly
seems possible, but how? Is there a utility
to add a WAV header to an MP2 file, to be
used with VirtualDub?

DJ Bobo
11th April 2002, 22:45
NO WAY

Convert to WAV then MP3, you can use 224kbps MP3, you won't remark any difference, the bitrate is high enough

DSPguru
11th April 2002, 22:51
Originally posted by bobotns
NO WAYARE YOU SURE ?! isn't there any acm variations of mpglib ?Convert to WAV then MP3, you can use 224kbps MP3, you won't remark any difference, the bitrate is high enough btw, lame (& BeSweet) can transcode directly from mp2 to mp3. no need to create a wav file.

dinston
12th April 2002, 00:22
Yes, convert to mp3, this is what I have done many times.
But if I had the option of retaining the ORIGINAL mp2 track
without conversion, I would do it.

Is there a legitimate reason this cannot be done, or would
be very difficult to do? Or is it just that no one has ever
bothered to implement it because mp3 is superior?

dinston
12th April 2002, 00:30
"transcode directly from mp2 to mp3"

Does this mean that the exact original audio is maintained
(lossless)? I can imagine the possibility of repackaging
the layer 2 info in a layer 3 stream? Or is it decoded
then re-encoded? Sorry if my terminology is wrong, I don't
have extensive knowledge of mpeg audio.

movmasty
12th April 2002, 00:41
there was a thread on the old doom forum where the autor of nandub showed the way to implement mp2 in avis,
as i remember you should put the mp2 in a wav file, like with riff mp3
wait that i search it

movmasty
12th April 2002, 01:28
here is the htm of the thread,
as i read it is possible :)

(hey guru,who is that guy in the pic?seems familiar to me)

movmasty
12th April 2002, 01:37
maybe better that i copy here just the main post

Let me first state that VBR MPEG layer 2 probably won't ever be supported in AVI files. Various reasons for this : I don't think that the M$ MPEG Audio decoder has been designed for it, and when you see the WAVE_FORMAT tag M$ defined for MPEG audio, it's obvious that they didn't even know it was possible.

Now, if your mp2 file is CBR and if it plays in WMP, there's no reasons why it wouldn't work exactly the same way as for CBR mp3. The only problem is to first encapsulate the .mp2 file in a .wav one (i.e. just add correct WAV-headers).

A simple way to do it is to use GraphEdt (@Doom9 : following belongs to some How-To page on your site I think)
------------------------------------------------------------
- verify that the file plays in WMP.
- Start GraphEdt
- Insert the 'File Source (Async.)' filter and select your .mp2 file (let's assume it's toto.mp2)
- Insert the 'MPEG-I Stream Splitter' (and connect its input to the output of the previous one)
- Insert the 'WAV Dest' filter (and connect its input to the output of the previous one)
- Insert the 'File writer' and choose a target filename (I suggest toto.mp2.wav so that you don't confuse with uncompressed waves)
- Hit the play button

Now, you have a WAV file on your disk that you can use in VirtualDub (or Nandub of course), just like you can use WAV-encapsulated CBR mp3 files.
------------------------------------------------------------
Note : I tested it, it works, that is, I've got a video and a mp2 audio stream in an AVI file which played ok in WMP (both audio and video were smooth). But I couldn't check for other possible problems like gradual desynchs. Mirekpr, please tell us about your experiments, thanx.

DSPguru
12th April 2002, 10:21
Originally posted by dinston
"transcode directly from mp2 to mp3"

Does this mean that the exact original audio is maintained
(lossless)? I can imagine the possibility of repackaging
the layer 2 info in a layer 3 stream? Or is it decoded
then re-encoded? Sorry if my terminology is wrong, I don't
have extensive knowledge of mpeg audio. it's a lossy process (decode+encode).
you shuold try to add a riff header to the original mp2 and just mux.

Originally posted by movmasty
(hey guru,who is that guy in the pic?seems familiar to me) me ;)

LigH
12th April 2002, 10:55
I know that QDesign released an MP2 ACM codec (I once had a Radium release...), but it is commercial, and because it required quite a lot more bitrate to achieve the same quality as LAME MP3s (due to the nature of MP2), I never really used it; and I wouldn't recommend someone to use it.

But if you want to use MP2 audio e.g. directly from the DVD (like many people do it with AC3), just do it. I wonder if Nandub is able to mux it like MP3...

@movmasty: You wrote that you successfully added a RIFF header - which tool did you use (wavmp3?), and which ACM codec format number did you get (0x55 like MP3? I think MP2 already has a different format number registered at Microsoft...)?

DSPguru
12th April 2002, 10:59
i believe robUx4 have added decoding support to lame acm, based on mpglib.
if that's the case, it should be able to decode mp1/mp2/mp3.

Dg.

LigH
12th April 2002, 11:04
The Moonlight Odio Dekoda by Elecard is a directShow filter which is able to seamlessly switch between AC3, MP2 and MP3 audio streams if necessary - at least it reports to be able to decode them all.

movmasty
13th April 2002, 01:46
Originally posted by LigH
@movmasty: You wrote that you successfully added a RIFF header

>thread on the old doom forum where the autor of nandub showed the way
-that i wrote, the post that i quote is from the autor of nandub

>which tool did you use (wavmp3?)
-me dont use mp2, seems to me that the tool used was graphedit

>I wonder if Nandub is able to mux it like MP3...
(Now, you have a WAV file on your disk that you can use in VirtualDub (or Nandub of course), just like you can use WAV-encapsulated CBR mp3 files.
Note : I tested it, it works, that is, I've got a video and a mp2 audio stream in an AVI file which played ok in WMP )

read, the author of ndub said its able.....

@guru
uhmmmm, Pareto maybe?

DSPguru
13th April 2002, 07:53
Originally posted by movmasty
@guru
uhmmmm, Pareto maybe? no.

LigH
13th April 2002, 14:24
Originally posted by movmasty
>thread on the old doom forum where the autor of nandub showed the way
-that i wrote, the post that i quote is from the autor of nandub


Oops, my fault - must have read in a hurry...



>I wonder if Nandub is able to mux it like MP3...
Now, you have a WAV file on your disk that you can use in VirtualDub (or Nandub of course), just like you can use WAV-encapsulated CBR mp3 files.
Note : I tested it, it works, that is, I've got a video and a mp2 audio stream in an AVI file which played ok in WMP


Well, muxing a WAVE encapsulated CBR audio is no big problem. But muxing an MP2 directly with the VBR MP3 import probably won't work?! (At least I doubt it - I'd have to try...)

The post by Nando you are talking about, can you post its original address, please? (It would require much efford by someone who doesn't know it to search for it.)

movmasty
14th April 2002, 04:37
Originally posted by LigH
The post by Nando you are talking about, can you post its original address, please? (It would require much efford by someone who doesn't know it to search for it.)
ehm, read my post above
the thread was on the OLD doom forum(yess,there was an old too :D )
but i attached the page like zip,you can dl and read it :rolleyes:

@guru
"Every transfinite consistent"
ohhhhhh, Cantor then??

DSPguru
14th April 2002, 06:09
Originally posted by movmasty
@guru
"Every transfinite consistent"
ohhhhhh, Cantor then??indeed !!

Zhnujm
14th April 2002, 14:01
the method above works good, i use it when i cannot convert the mpa file because of errors. cant see any problems with audio video sync. for playback the "microsoft mpeg-1 audiodecoder" is used. i didnt install anything special for playback.

movmasty
15th April 2002, 05:33
okie....just wait that i find a pic of Gödel.....

DSPguru
15th April 2002, 05:44
Originally posted by movmasty
okie....just wait that i find a pic of Gödel..... will you use it as your avatar :D ?

if i remember correctly, he wrote his incompleteness theorem when he was 24, right ? what a genious.. :D.
his work is extremly important to math & logics, but imho, cantor is the best :p

movmasty
16th April 2002, 03:45
yes, the numbering of infinite is one good,
but Gödel made like ten theorems of the same importance, showing the limit of human reason and scientific theories.