View Full Version : low bitrate VBR mp3 in AVI
I get some strange results when I try to mux a mp3 VBR at aprox. 64 kbps into an AVI (video is divx). When I encode the same audio to CBR at 96 kbps or VBR at higher bitrates (i.e. aprox. 112 kbps) everything works fine.
Both, the video and the sound have the same length of of 1 hour and 55 minutes.
Nandub: completely out of sync. Video plays twice as fast, sound plays normal but the file ends when the video is finished and the sound is at 50%. The stats window of Nandub shows only 27 MB audio data (the mp3 file is 54 MB). The video player displays a run length of 1:55.
VitualDubMod: everything is in sync and fine for the first half of the video but the 2nd half has no sound at all. It also has only 27 MB audio.
AVIMux: similar to Nandub, i.e. video at 2x speed. But the player now displays a length of 3:50 and the audio is playable over the full distance but the video turns into a black screen after 50%. The file size is as expected (54 MB audio) and GSpot displays the correct runtime of 1:55.
The mp3 file seems to be ok and it plays correctly in winamp over the full distance with a correct time display. It was encoded with lame 3.95.1 and "-h --preset 64" settings which included a downsampling to 24kHz (joint stereo). I also tried lame 3.90.3 with similar settings, but same results.
The video is a divx stream that I did encode 2 years ago with some DivX 4 and VirtualDub.
Well, I understand that the VBR support in AVI is a hack but nevertheless it usually works fine. I can't use another container format this time, and I can't use a higher bitrate without having to reencode the video.
So I wonder whether there exists some limitation that makes this VBR hack unusable at lower bitrates or whether it is simply a bug in all :confused: the tools I tried. BTW, 64 kbps and even 48 kbps mono mp3 CBR works fine.
Are there any other tools for muxing that might work?
Btw: What I really want to do is replacing a mono stream of an old file with a stereo stream without making the file bigger. And the 64 kbps VBR sounds much better than I expected at this bitrate.
PS: I know AVI is not really a "new" container, but it still is a container and I didn't find a more apropriate subforum.
bond
8th March 2004, 22:20
welcome to doom9 :)
hm maybe the frequency (24khz) is causing problems
as you reencoded to a higher bitrate, what frequency did you get?
also try to reencode the mp3 to 64kbps with 24khz and 44.1khz and report the results
thanks for the welcome bond. :cool:
You are right, it seems to be the sampling frequency. I encoded the mp3 again with "-h --preset 64 --resample 32" and the AVI came out as intended from Nandub this time.
I haven't tested VirtualDubMod and AVIMux yet.
As this particular audio stream sounds almost exactly with 24 and 32 kHz I can live with this solution very well, but it still looks like a bug to me, esp. since VirtualDubMod seems to proof that using 24 Khz VBR is possible in AVI.
Maybe the tools are just "surprised" that someone really wants to use frequencies that low and try to to fix it. :D
The former tests with higher bitrates were 44.1 kHz for the 122 kbps VBR and 32 kHz for the 96 kbps CBR.
Thanks for your help.
alexnoe
9th March 2004, 01:50
i'll see if I can reproduce that bug. If I can reproduce it, maybe i can fix it in avi-mux gui
bond
9th March 2004, 09:04
great that it worked
btw if you have to go for 64kbps and dont have a hardware player supporting only mp3, you should definitely use he-aac or vorbis for 64kbps!
you will get universes of better quality than with mp3 on that bitrate (look here (http://www.rjamorim.com/test/64test/results.html))
SeeMoreDigital
9th March 2004, 14:02
I remember coming across speed problems when encoding Mp3 at 64kbps CBR with Lame but not with Radium at 64kbps CBR
All Mp3 VBR encodes with Lame came out very sloooow!
As yet all my Nero low bitrate AAC LC and AAC HE audio has worked fine when muxed with MP4UI and with AVI-mux.
Cheers
Ok, now I have tested VirtualDubMod and AVIMux with the 64 kbit 32 kHz VBR too. Both results were fine. The sizes of the Nandub and VDM AVIs were almost identical and 3.8 MB larger than the AVI produced by AVIMux.
I also tested all 3 programs with a CBR 64 kbps 24 kHz mp3. Nandub yielded the same mess as with VBR, but VDM and AVIMux produced correct files.
@alexnoe: It would be great if you could find the cause of it. Please let me know if I can help you to reproduce this.
@bond: Actually I want to have this movie playable on a hardware player that seems to be able to play VBR mp3 (Medion, german ALDI), but no AAC just mp3 and WMArgh. That's why it had to be mp3 and less than 700 MB. But I can't test it before next week.
Regarding the quality of the audio track, it appears to be really good! Well, I now switched to VBR 69 to also use the last bytes available but it's still a surprise. I mean I can't easily tell the difference from the original. Maybe I could if I really searched for differences but they are not apparent to me, even the lowpass (ca. 11kHz) is not recognizable with this track. The audio track is a german dubbing and has long dialog parts in mono, some true silence and some music and background sounds that are stereo.
@SeeMoreDigital: The encoding time was about 15-20 minutes on a 1.7 GHz P4 for 115 minutes audio. I wouldn't consider this as too slow.
SeeMoreDigital
9th March 2004, 23:00
Originally posted by x4u
@SeeMoreDigital: The encoding time was about 15-20 minutes on a 1.7 GHz P4 for 115 minutes audio. I wouldn't consider this as too slow. Actually, I was not talking about the encoding. I was talking about the decoding ie playback!
Cheers
alexnoe
10th March 2004, 12:09
The mp3 file seems to be ok and it plays correctly in winamp over the full distance with a correct time display. It was encoded with lame 3.95.1 and "-h --preset 64" settings which included a downsampling to 24kHz (joint stereo). I also tried lame 3.90.3 with similar settings, but same results.More important Lame 3.95.1 encodes as MPEG 2 Layer 3 with this setting...which I never really tried with AVI-Mux GUI :D So i'll try now...
OK, it is b0rked. The problem is that MPEG2 Layer3 Frames contain only half as many samples as MPEG1 Layer3 Frames :-( That means I need to write different headers for MPEG2 Layer3 (or write 2 frames per chunk, but I prefer writing different headers). I'll fix it for the next release.
bond
10th March 2004, 12:25
Originally posted by x4u
Regarding the quality of the audio track, it appears to be really good! Well, I now switched to VBR 69 to also use the last bytes available but it's still a surprise. I mean I can't easily tell the difference from the original. Maybe I could if I really searched for differences but they are not apparent to me, even the lowpass (ca. 11kHz) is not recognizable with this track. The audio track is a german dubbing and has long dialog parts in mono, some true silence and some music and background sounds that are stereo.hm yep maybe encoding everything as mono is a good idea to get more quality (also most tv sets output mono anyways)
also you should look into the fhg encoder, which is said to be much more tuned for low bitrates than lame (it supports some feature helpfull for low bitrates which lame doesnt have)
look at the used settings here (http://www.rjamorim.com/test/64test/presentation.html)
alexnoe
10th March 2004, 13:27
This test version (http://www-user.tu-chemnitz.de/~noe/amg.zip) can handle MPEG2 Layer3 audio now. There has been changed more, so if anything b0rks, tell me...
x4u
10th March 2004, 15:41
@alexnoe: The new version looks good if I play the video from the beginning. But if I jump/seek in the video the audio is not in sync anymore. Both audio and video play at normal speed, but seeking in the video seems to seek 3 times faster in the audio now. I hear the end of the audio track if I seek to 34% in the video.
BTW: If the source video already had an audio track, I get 2 tracks in the result from AVIMux-GUI even if I turn off the checkbox for the track from the source video.
One other thing I noticed is that the original WMP 6.4 doesn't play the 24 kHz mp3 tracks correctly (neither CBR nor VBR, but 32 kHz VBR is ok). Winamp has no problems at all and needs virtually no CPU time.
@bond: Thanks for your hints, I'll do some tests with the different encoders to see how low I can go. I'd love to have a 2 pass audio encoder and one that can dynamically change the sampling frequency and thus adapt the lowpass depending on the current input. This should allow to go for really low average bitrates for many movie tracks. The required bitrate varies much more over the runtime of a movie than during the music clips which seem to be currently the main basis for testing and tuning encoders.
alexnoe
10th March 2004, 15:47
@alexnoe: The new version looks good if I play the video from the beginning. But if I jump/seek in the video the audio is not in sync anymore. Both audio and video play at normal speed, but seeking in the video seems to seek 3 times faster in the audio now. I hear the end of the audio track if I seek to 34% in the video.Which player? This is kinda funny, because I have not had that issue :eek: Neither in MPC nor in TCMP ...
BTW: If the source video already had an audio track, I get 2 tracks in the result from AVIMux-GUI even if I turn off the checkbox for the track from the source video.Did you disable the 'all audio streams' check box? :p
x4u
10th March 2004, 16:27
Originally posted by alexnoe
Which player? This is kinda funny, because I have not had that issue :eek: Neither in MPC nor in TCMP ...
Did you disable the 'all audio streams' check box? :p
It was BSPlayer 1.0, but I get the same behavior in Zoomplayer, original WMP 6.4 and RealOne Player too. Only in MPC everthing is fine.
It also didn't help to remove all unnecessary filters Graphedit.
All what I left was AVI Splitter->mp3 Decoder->Default Direct Sound Device and Divx Decoder->Video Renderer.
The mp3 decoder is the FhG IIS version 1.5 from 1999. I use Win2k with SP4 and DirextX 9.0b.
Originally posted by alexnoe
Did you disable the 'all audio streams' check box? :p
Well, now I did and it came out as expected. ;)
Thank you very much for your efforts and this great tool.
alexnoe
10th March 2004, 16:31
OK, i just tried graph edit, and it really does not work :o
x4u
10th March 2004, 16:36
Maybe it helps to look at what the latest VirtualDubMod generates. It seemd to be good at least in the first half of the video.
SeeMoreDigital
10th March 2004, 16:58
I'm not entirely convinced that the Lame codec is faultless when it comes to generating Mp3 VBR encodes
I just generated an Mp3 VBR at 64kbps using MusicMatch and it seems more stable when muxed!
Hope this helps somehow!
Cheers
alexnoe
10th March 2004, 21:25
Same download location again. I can now play the files in MPC and GraphEdit :D
x4u
11th March 2004, 03:52
Originally posted by alexnoe
I can now play the files in MPC and GraphEdit :D
Me too, everything is fine now. Thanks a lot.
http://ed2x.com/thumbs.jpg
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.