digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Video Encoding and Conversion (http://www.digitalfaq.com/archives/encode/)
-   -   TMPGEnc produces errors on Audio VBR Conversion? (http://www.digitalfaq.com/archives/encode/1499-tmpgenc-produces-errors.html)

Jellygoose 11-05-2002 12:33 PM

TMPGEnc produces errors on Audio VBR Conversion?
 
Alright here's my problem... don't know if anyone can help me with this...

I have several pre-encoded DivX Avi DVD-Rips, which I encoded with a VBR MP3 audio... So far...
Now I wanna re-encode them as a VCD, but TMPGEnc is giving me a hard time... no problem with the video but :

1. TMPGEnc produces errors whenever i try to open the AVI file for the
audio source...

After that I decompressed the audio with Virtual Dub and saved it as a Wav File.

2. TMPGEnc opens the wave file, but audio starts for example 4 seconds too early. so Video is not in sync with the audio...


I know it has something to do with the Variable Bitrate for audio, but shouldn't it be in sync after i decompressed it??

Boulder 11-06-2002 08:16 AM

If you are using Avisynth v2.06, try the function "EnsureVBRMP3Sync()". It has worked well on my encodes.

This is how I've done my encodes:

I put the line EnsureVBRMP3Sync() right after the line where the AVI file is loaded. Then open the avs script in VirtualDub, select 'full processing mode' for the audio and save as WAV.

Then I edit the script and disable audio by editing the AVISource line so that it says AVISource("c:\temp\capture.avi", false).

Then I load the script in TMPGEnc, put the WAV as audio and it works fine. I usually encode the audio with BeSweet and mux the files afterwards, but it will work like this as well.

kwag 11-06-2002 09:25 AM

Hi Boulder,

You can also do this:

AviSource("c:\WhereEverYourAviPathIs\movie.avi")
EnsureVBRMP3Sync()
Trim( 0, 0 )

The Trim( 0, 0 ) is a dummy trim, which ensures sync on the complete avi. Now there's no need to extract the audio with Vdub. Just open TMPEG and open this .avs as video and audio source and process with all your favorite filters added. :wink:

-kwag

Boulder 11-06-2002 10:35 AM

Hi Kwag,

that's true. The main reason why I've extracted the audio in VDub is that I'll be able to encode it via BeSweet and get the volume normalized. Your script will be at least easier to use :wink:

kwag 11-06-2002 10:39 AM

Hey Boulder,

You can use SCMPX as an external audio encoder in TMPEG. The results will be the same ( or better ) than if you had encoded the audio with BeSweet. Grab it here: http://www.din.or.jp/~ch3/scmpx_e.html ;)

-kwag

Jellygoose 11-06-2002 11:31 AM

Thanks Guys I'll give it a try in a few minutes but it sounds good!

;)

Jellygoose 11-06-2002 11:51 AM

:?
Doesn't work...

TMPGEnc doesn't load the avs script anymore :
"Script Error : There is no function named "EnsureVBRMP3Sync"

Is it my MPEG2DEC.dll ??

kwag 11-06-2002 12:00 PM

Quote:

Originally Posted by Jellygoose
:?
Doesn't work...

TMPGEnc doesn't load the avs script anymore :
"Script Error : There is no function named "EnsureVBRMP3Sync"

Is it my MPEG2DEC.dll ??

You must get AviSynth 2.0.6. Get it here: http://sourceforge.net/projects/avisynth2

-kwag

Jellygoose 11-06-2002 12:14 PM

Ok, now there's no problem loading the script anymore but...

audio still starts too early... makes me go crazy...

:oops:

kwag 11-06-2002 12:17 PM

If you're encoding to MPEG-1, remember to playback on WMP. Not on WinDVD or PowerDVD. For MPEG-2 then you can use WinDVD. WinDVD doesn't like MPEG-1 VBR. Try loading your .avs directly with WMP. It should play and the audio and video should be in sync.

-kwag

Jellygoose 11-06-2002 12:25 PM

I know it should be... :cry: it's not in sync... neither in WMP nor in VirtualDub...

I'm sure i spelled it right (triple-checked...)

what could it be?

Jellygoose 11-06-2002 12:48 PM

well... could it be my DivX Codecs maybe??
I installed the Nimo Codec Pack, and not the DivX Bundle from divx.com ...

When i started VirtualDub first it told me that i was using hacked drivers and that this might lead to errors...

muaddib 11-06-2002 12:57 PM

Could be that your audio needs a bigger initial delay.
Try to extract the WAV as told, and use headac3he to encode to mp2, but before you start, add the delay manually in the "delay box" right under "source file". I never had to do that, so I don't know if there is an easier way to find the right delay, besides trial and error.

Jellygoose 11-06-2002 01:05 PM

I tried that before but that didn't fix the problem because later the audio got out of sync again... there must be some other solution to it, because i got 2 dvd rips with VBR audio and the "EnsureVBRMP3Sync" function didn't change anything in either of them...
the audio of the DivX file is perfectly in sync by the way...

Jellygoose 11-06-2002 01:09 PM

I just got an idea, might be stupid though...
couldn't i just "record" the audio of the avi file somehow? is there a problem that just records the sounds you play on your computer and puts it into a PCM Wav file?

Yoda 11-06-2002 01:36 PM

I use to have that same problem. I had to uninstall everything and start over to get the audio to sync. Seems to be a problem with the avi codecs. Try uninstalling codecs and software then install DVD2SVCD. This will load all the codecs. Try encoding to see if the audio is in sync then if it is, install the divx codecs. There may also be a priority issue with TMPGenc. Look at the environment settings and move the huffyuv codec to a higher priority.

-Yoda

Jellygoose 11-06-2002 04:09 PM

Hi Yoda...

I don't think it's the Environmental Setting... I don't even have the huffyuv codec, plus the problem with audio out of sync is also in Virtual Dub...
I'll try a couple of things with the codecs and see if one of them works... i downloaded the DivX Bundle, and the standard Media Player Codecs...

Jellygoose 11-06-2002 04:30 PM

I dpn't really understand how you got rid of the problem yoda... what do you mean uninstall "everything"? and what did you install after that? just DVD2SVCD ?

Yoda 11-06-2002 05:02 PM

Uninstall Divx and any other codecs you can. Install DVD2SVCD. This will give you all the files you need and will install the needed codecs. Then try the program. It has a check to either rip DVD or use AVI for the input. Read the forum here in KVCD.net on DVD2SVCD. Once you have a successful encoded movie then install Divx for whatever you need it for. This should tell you if Divx is interferring with your encodes.

-Yoda

Jellygoose 11-07-2002 11:24 AM

Hi Yoda!

Thanks for helping me with this but... I took the steps you suggested, and indeed something changed... Now again TMPGEnc and WMP give me the error:

"ACM failed to suggest a compatible PCM format"
(C:\Movies\Movie.avs, line 2)

8O What is that again? well at least something changed... any ideas?

Yoda 11-07-2002 11:38 AM

What does line 2 of the .avs file say?

Jellygoose 11-07-2002 01:15 PM

Quote:

Originally Posted by Yoda
What does line 2 of the .avs file say?

That's the EnsureVBRMP3Sync () line...

Yoda 11-07-2002 02:57 PM

Quote:

That's the EnsureVBRMP3Sync () line...
I don't use that function.

-Yoda

Jellygoose 11-07-2002 04:19 PM

Quote:

Originally Posted by Yoda
I don't use that function.

-Yoda

:P Me neither... kwag told me to use it because when i tried to encode DivX Movie with the VBR MP3 Audio the audio was like 4 seconds behind the video...

Guess I'll give it a shot without that line... thanks a lot for your help yoda...

BtW: I liked your fighting Action in Episode II... ;)

J-Wo 02-09-2003 01:17 PM

Arrgh! I'm still have problems with audio sync when converting an Xvid of Sweet Home Alabama with VBR MP3 audio. When I stumbled upon this thread about EnsureVBRMP3Sync I thought I found the solution, but it seems I'm having the same problems as Jellygoose! I've tried every combination possible, from loading the AVS into vdub and extracting the wav and the mux'ing vid+aud at the end, to letting Tmpgenc do all the muxing and encoding. Then I tried this:

Kwag:
Quote:

If you're encoding to MPEG-1, remember to playback on WMP. Not on WinDVD or PowerDVD. For MPEG-2 then you can use WinDVD. WinDVD doesn't like MPEG-1 VBR. Try loading your .avs directly with WMP. It should play and the audio and video should be in sync.
But even when I load my avs directly into WMP v8 my audio is still earlier than the video! But the original avi file plays perfectly in sync. What is wrong with me?!?! :x :cry: Here is my current AVS file:

Code:

LoadPlugin("d:\program files\avisynth2\plugins\MPEG2DEC2.dll")
LoadPlugin("d:\program files\avisynth2\plugins\LegalClip.dll")
LoadPlugin("d:\program files\avisynth2\plugins\Blockbuster.dll")
LoadPlugin("d:\program files\avisynth2\plugins\FluxSmooth.dll")
LoadPlugin("d:\program files\avisynth2\plugins\Sampler.dll")
LoadPlugin("d:\program files\avisynth2\plugins\GripFit_Preview.dll")
LoadPlugin("d:\program files\avisynth2\plugins\decomblegacy.dll")
LoadPlugin("d:\program files\avisynth2\plugins\dustv5.dll")
LoadPlugin("d:\program files\avisynth2\plugins\temporalcleanerold.dll")
LoadPlugin("d:\program files\avisynth2\plugins\convolution3d.dll")

avisource("E:\Movies\Sweet.Home.Albama.DVDRip.XViD-ViTE\sha-xvid.avi")
EnsureVBRMP3Sync()
Trim( 0, 0 )
LegalClip()
#FieldDeinterlace()
GripCrop(528, 480, overscan=2)
GripSize()
SpaceDust()
TemporalCleaner()
#Blockbuster(method="noise", variance=.3, seed=1)
GripBorders()
LegalClip()

My last thought is perhaps I don't have the right codecs. I've tried removing all codecs and packs (e.g. nimo) and then installing only the ones I need. But I was having trouble finding a good MP3 audio codec. Does anyone have a link to one, and also the recommended Xvid codec? There seem to be so many... Thanks!

kwag 02-09-2003 01:41 PM

Quote:

Originally Posted by J-Wo

But even when I load my avs directly into WMP v8 my audio is still earlier than the video! But the original avi file plays perfectly in sync. What is wrong with me?!?! :x :cry:

Try a script like this and see if it plays out of sync in WMP. It shouldn't. 8O

Code:

LoadPlugin("d:\program files\avisynth2\plugins\MPEG2DEC2.dll")
avisource("E:\Movies\Sweet.Home.Albama.DVDRip.XViD-ViTE\sha-xvid.avi")
EnsureVBRMP3Sync()

Just to remove the possibilities of a filter interaction in your machine.

-kwag

J-Wo 02-10-2003 09:32 AM

Quote:

Try a script like this and see if it plays out of sync in WMP. It shouldn't. 8O
Well this is weird, it DIDN'T work! But fear not, I finally figured out what to do. I loaded the same template I posted earlier into Tmpgenc as video source, then for audio source I loaded the original AVI file. But the big thing I had to learn was I needed to turn on Directshow Multimedia File Reader in the VFAPI settings. The reason this took me forever (like we're talking weeks) to get to work is that there's a post here in these forums on how to optimize tmpgenc for KVCDs, and they say to have all VFAPI plugins turned off *except* ReadAVS.dll. 8O Maybe there should be a note somewhere about this!

Now here's my new question. I used SCMPX as an external audio encoder, and I was wondering if the result would be the same as encoding the audio seperately with Besweet or Headache. I kinda like letting Tmpgenc handle the audio because it certainly saves a lot of steps (e.g. extracting audio, encoding audio, muxing vid+aud) and HD space for temp files. It it just seems like the process is faster with SCMPX (I could be wrong though).

kwag 02-10-2003 10:17 AM

Quote:

Originally Posted by J-Wo

Now here's my new question. I used SCMPX as an external audio encoder, and using this I was able to preserve the origianl 48khz audio without downsampling, and my final MPEG sounds fine. However if I use Besweet or Headache, I always HAVE to downsample to 44khz, otherwise the final muxed video sounds low in pitch and out of sync. Any idea what's going on here???

Do you mean that the audio done with SCMPX at 48Khz does play correctly on your standalone, but the same audio at 48Khz done with HeadAC3he doesn't 8O :?:

-kwag

J-Wo 02-10-2003 10:25 AM

Quote:

Do you mean that the audio done with SCMPX at 48Khz does play correctly on your standalone, but the same audio at 48Khz done with HeadAC3he doesn't 8O :?:
Ack my apologies. The file plays fine on my computer but when I burned it and played it on my player the sound WAS low and out of sync. So I guess my player can't handle 48khz audio. I just edited my msg in the hopes that no one would reply so quickly, but guess I was wrong! :oops:

francks 02-11-2003 03:48 AM

I have the same exact problem with that same movie and the audio is like 3 s before the video. I had tried just about everyhing except the VFAPI settings. Which I did last night but I still get the sync problem. The funny part is that the orignal movie is 1:48:51 in lenght but the wav extracted by besweet is 1:48:48. Could that be the problem and why would that happen?


All times are GMT -5. The time now is 03:21 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.