PDA

View Full Version : Audio sync problem capturing mpg2


Acceler8n
13th November 2002, 10:01
I capture mpg2 videos of TV shows and when I try to convert them to DivX, I get an audio sync problem. I use DVD2AVI and the audio file that is created has this file name:

testing MPA T01 DELAY 156ms

When I try using a different capturing software, the delay is -14ms and the audio sync is almost perfect, (compared to the first one)

Does anyone know how to fix this or how to capture video and audio in mpg2 so that the audio will be in sync when converted to DivX?
I am using PowerVCR II to capture the mpg2 with 156ms and use AverMedia's software to capture the -14ms mpg2. I thought PowerVCR II was suppose to be better than AverMedia's software.

Swan
13th November 2002, 18:35
Does anyone know how to fix this or how to capture video and audio in mpg2 so that the audio will be in sync when converted to DivX?
The delay value should not present a problem. As long as you use the same audio delay in the Audio tab of GordianKnot (it should insert the correct value by itself, as it reads it from the audio file you feed it).
Just to make sure this isn't the problem (that Gordian sets no delay, even though there should be one), open your finished DivX in Nandub.
Set Video to DirectStream copy. On the audio, select your mp3 and under Interleaving and Audio Skew Correction, enter the value DVD2Avi gave you. This value can differ from file to file.

If you do this and the final DivX still has a problem with audio and video not being in sync, and you are certain that the Mpeg-2 file has perfect audio/video sync, then you have a problem. You can try chopping the Mpeg-2 file up into parts of 15 minutes each, encoding each part separately, that usually does the trick. The audio delay will be different on the files, so don't try to append them, let them be encoded as separate DivX files. How long is the video you are encoding, by the way?

The next step is try capturing using another software.
And test lowering the bitrate, test lowering the resolution in PowerVCR. Basically Acceler8n, you are in unknown territory. You have to spend a lot of time testing stuff to see what works for *you*.
Not very many people will be able to help you on these forums.
Or they're all lurkers. ;)

This is *so common* in Mpeg-2 capturing, but rarely discussed in these forums, as most posters here capture in HuffYuv or Mjpeg and compress to DivX.
I can say that for me, what helped was
1. Dividing the Mpeg-2 into smaller parts and encoding each part separately. This works on files captured with PowerVCR.
Or 2. using a different software when capturing. In my case, Ulead VideoStudio seems to provide the most robust Mpeg-2 files. PowerVCR comes in second.

I have not completely solved the mystery as to why audio and video may be in perfect sync on the Mpeg-2, but goes out of sync when converted to another format. But I am leaning towards that the software we use produce poor Mpeg-2 files, files that are not fully compliant to the standard. Or that DVD2avi and Mpeg2dec.dll are not as kind and accepts flaws in the Mpeg-2 file as a software DVD player obviously does. There may be some error correction in the DVD software players that is not included in DVD2Avi or Mpeg2dec.

I have bought three books now which will hopefully reveal the Mpeg-2 audio and video encoding mysteries to me. :)

I have a strong feeling that the Mpeg-2 encoders (the software we use to capture Mpeg-2 video with) are full of flaws. They're intended to let us capture stuff, watch it and throw it away or burn directly to DVD. Those who design these softwares don't have in mind that the files need to be flawlessly encoded, following the Mpeg-2 standard to 100%, so they can be edited without causing problems and also, converted to other formats. I am convinced that professional Mpeg-2 software encoders, if they exist, gives much better results.

But the delay in itself is not something that causes audio and video to go out of sync. Many, if not all of the DVD's I've encoded also have a delay value. -66 is very common. So, try adding the audio to the video manually in Nandub, making sure you enter the correct delay and if that doesn't help, try other encoders (other capturing softwares).

The Mpeg-2 file you encoded now, has it been edited to remove commercials?
With what software?
If it was edited to separate Mpeg-2 files: did you chain them together in DVD2Avi?

/Swan

Acceler8n
13th November 2002, 21:38
Hi again Swan,

No actually this is the original mpg2 captured from my TV card. I took your advice and got PowerVCR II and tried capturing with PowerVCR II. The mpg2 looks great but then there is that audio sync problem when converting. The AverMedia software's mpg2 when converted to divx was in better sync then the PowerVCR capture. I'm going to try converting them by parts....thanks again Swan, you are very helpful and informative as always.

Swan
14th November 2002, 01:07
Acceler8n
It's a constant battle! But I choose to do these things, not because they are easy, but because they are hard. :-)

Good luck with your file. Yes, divide it into parts.
This is how I encode the most stubborn Mpeg-2's (but I am also experimenting with using Suzahara's tip on using Trim in Avisynth)
Make a d2v project of each and every one of the files.
Make sure you note the audio delay (it will be different on the separate files).
This (different audio delay values) is the reason why you can't join them together later (after you've encoded them to DivX).

/Swan

Acceler8n
15th November 2002, 03:22
Swan,

When I used PowerVCR's trim function to cut mpeg2's, I do not get a precise cut. Is this normal for you also? And what would I have to do to get precise cuts using PowerVCR? (in mpeg2 this time, not divx )

Swan
15th November 2002, 17:00
Don't use PowerVCR's editing tools.
They are no good and hard to use.
Try any of these instead (I took the liberty to add my views):

TMPGEnc (MPEG Tools):
+demo version is not limited in functionality while trial period lasts
+easy to use
+easy to find support for on the web and these forums
+cheap
-buggy
-too small preview window
-a bit slow
-depends on Mpeg-2 codec installed in Windows

M2-Edit Pro
+works extremely well
+lighting fast
+has tools for normal playback, reversed playback
+does not depend on Mpeg-2 codec installed in Windows, but comes with its own (Elecard) which in addition can be turned on and off.
-edited files always has audio delays
-hard to learn user interface (there's a guide on vcdhelp's web site)
-limited demo version
-expensive

Womble Mpeg-VCR:
+works very well
+easy to use interface (there's a guide on vcdhelp's web site)
-slow on large files
-has occasionally produced garbage
-limited demo version
-expensive

Vitec Video Clip MPEG-2 Pro:
+ offers both frame accurate (lossy) and GOP accurate editing (lossless)
+always produces a 0 delay
+pretty fast
-sometimes hangs when mixing audio and video together, on Mpeg-2 files produced by PowerVCR.
-limited demo version
-no audio available
-expensive


/Swan

stax76
2nd December 2002, 23:01
my experience is demuxing mpg files recorded with DVB programs DVD2AVI usually goes out of sync, PVAStrumento does a great job demuxing mpg files

Acceler8n
3rd December 2002, 11:12
To Dolemite,

After I Demux the audio from the mpeg2 file, do I use this audio file when converting to mp3 and muxing it back with the video in GordianKnot? I still have to use DVD2AVI to get the .d2v file right? Thank you for yor reply.

stax76
3rd December 2002, 17:40
@Acceler8n

I demux with PVAStrumento, convert mp2 to wave with BeSweet, make a d2v file with DVD2AVI, make a AviSynth script and open the AviSynth script and the wave with VirtualDub and cut with VirtualDub and encode the video with DivX5 and encode the audio with Lame ACM CBR. There are many other ways but this is the way with the fewest problems and the highest compatibility

^^-+I4004+-^^
4th December 2002, 01:48
@Swan

so there are mpeg2 sync issues after all?
by your words i gathered it was perfect for anything
really.....
(but again.....not for raw video capturing obviously!)

one thing is keeping the sync on playback
(as it seems that mpeg2 capturing does)
and the other thing is CAPTURING PROPERLY!!!




[i'll get to you in the mail if i find anything i can
answer to.......probably yes then....you didn't told me what you go through to encode your mpeg2 capturings though....]

(and i still can't understand why capturing to mpeg2?
you loose quality,you get these funny issues etc.etc.
if you like quality you won't capture to mpeg2.....
and (by looking at the processes involved on coding that video)
you'll save your nerves.....it's ok for DVB,as it must be that way,
but for analog capture mpeg2?)

cheers

Ivo

Swan
4th December 2002, 13:01
@^^-+I4004+-^^
so there are mpeg2 sync issues after all? by your words i gathered it was perfect for anything
really..... (but again.....not for raw video capturing obviously!)

What I have written to you in *personal e-mails to you* is not something I think you should bring up here, Ivo. However, I will clarify this further down this message, anyway.

Acceler8n has problems converting his Mpeg-2 captures (captured with PowerVCR) to DivX. The audio and video gets out of sync on the DivX file, more and more towards the end. The sync is fine on his Mpeg-2 file.
This is nothing new to me, I have experienced it myself. With a different capturing software, the problem can go away, it can also be solved with the correct Mpeg-2 editing tools.

(and i still can't understand why capturing to mpeg2?
In my view, one of the best things about capturing to Mpeg-2 is that it ensures correct sync between audio and video, without resorting to destructive measures like resampling the audio (Vdub sync). This is very important to me, personally, and I'm sure to many others.
Mpeg-2 also keeps file sizes down, which is important to some people. Mpeg-2 isn't bad as a capturing format in my view and the resulting files can look darn near the original broadcast when output on the TV.

I personally like Mpeg-2 and the quality I get is better than VHS, SVHS and for that matter, any other format I have ever seen.
But, I am interested in capturing in a less lossy, yet high-quality format so I get excellent raw material which I will convert to DVD compliant Mpeg-2 with TMPGEnc.

But since audio and video going out of sync on avi capturing with Mjpeg or Huff for compression is a big problem, and the only means to solve this seems to be to use methods as in Vdubsync (altering the audio or dropping frames to achieve sync, none of which I find satisfactory), I am sticking with Mpeg-2 and am considering buying a Canopus ADVC which has locked audio.

Different strokes for different folks. Obviously, Mpeg has some form of timstamps and buffering that ensures audio and video sync when capturing over long periods of time. In avi-format with Mjpeg or Huff compression, this doesn't seem to be the case.
I have never experienced any bad sync on Mpeg-2 captures with Ulead VideoStudio or PowerVCR, even on two hour long captures the audio is spot on. But on my first attempts with avi (Mjpeg, Huff), I lost sync gradually, until after 35 minutes it was way off.
This is turning into another discussion now. If there is another format around which uses a non-destructive technique to capture high-quality video from a bt878 card and keeping the audio and video in sync like Mpeg does, I'd love to hear about it.

But Acceler8n , if PVastrumento doesn't help and you haven't tested it; do try to edit the Mpeg-2 files into separate, commercial free files and DivX encode these separately and you will not have sync problems anymore. Use a player that supports playlists such as ZoomPlayer to play the files in order.


/Swan

^^-+I4004+-^^
5th December 2002, 02:12
[What I have written to you in *personal e-mails to you* is not something I think you should bring up here, Ivo. However, I will clarify this further down this message, anyway.]


these are matters of general concern so it doesn't matter really...
(and i won't go into details....)










this is contradictory as ADVC captures to .avi files!
and a guy who tested it tells a story in which capturing the VHS with
"locked audio" setting produces some audio problems....(aside that it needs
TBC for proper VHS capturing.....)
but sure i wouldn't refuse giving a canopus+TBC(of some sort) a test drive on my system.....if it was 200% cheaper that is.....(heh)




[Different strokes for different folks. Obviously, Mpeg has some form of timstamps and buffering that ensures audio and video sync when capturing over long periods of time.]


or during playback only?obviously encoding problems exist.....
that means something is wrong with that file(?)




[But [B]Acceler8n , if PVastrumento doesn't help and you haven't tested it; do try to edit the Mpeg-2 files into separate, commercial free files and DivX encode these separately and you will not have sync problems anymore. Use a player that supports playlists such as ZoomPlayer to play the files in order.]


or you can alternatively merge these divx segments into one divx file
(NDub or AviUtil,or perhaps even newest VD (as avery corrected some audio related bug) can do it....)

Acceler8n
5th December 2002, 08:35
To Swan,

I just tried to capture video using PowerVCR in mpeg1 VCD settings. The resulting mpeg1 file was in good sync. I then used TMPGEnc to cut it into segments, and the resulting files were "out of sync". I used mpeg1 this time instead of mpeg2 to see if there was a difference. I didn't even bother converting the mpeg1 segments to divx because the mpeg1 files were already out of sync. My question is...

I've seen many people with mpeg1 video with commercials edit out with good sync. How are they doing it? TMPGEnc looks great except for the audio sync problem I have. I'm will not be converting the mpeg1 to DivX this time, but putting it straight on VCD. How are they doing the editting without loss of audio sync? Sorry if the question is repetitive, I thought I got the idea of it all, and I think I'm back to square one after this latest try.

Swan
5th December 2002, 10:11
@ Acceler8n The resulting mpeg1 file was in good sync. I then used TMPGEnc to cut it into segments, and the resulting files were "out of sync"
And you played the Mpeg-1 (the edited ones) in PowerDVD, or WinDVD, etc, to verify that the sync was off? Not just off in MediaPlayer?

Ok, then I'd suggest, try a different Mpeg editing software. For Mpeg-1, I'm sure there are many more titles to chose from.
If using different editors doesn't help, then test a different software for capturing. Test using VideoStudio and Intervideo WinDVR. WinDVR has a timer. Intervideo has just released a new software that is a combined "recorder" and DVD player called DVDRecorder. http://www.intervideo.com/jsp/Product_Profile.jsp?p=WinDVDRecorder that you also may want to try.

I have been capturing to Mpeg-2 for a year and have never had as bad problems as you. Each night I capture a 1 hr show with PowerVCR, edit it and never ever see any sync issues on the resulting Mpeg-2 files. I capture 1 1 1/2 - 2 hour shows often too, no sync issues.


I'm will not be converting the mpeg1 to DivX this time, but putting it straight on VCD.
I think your quality will be better that way, as opposed to DivX encoding a Mpeg-2 file with the same resolution as a VCD (mpeg-1) file, as you've done before.

How are they doing the editting without loss of audio sync? Sorry if the question is repetitive
I's no problem, I just want to help you out.
Test the editors I wrote about above, especially M2-edit is reliable in keeping sync. Also, for Mpeg-1, there are likely to exist freeware editing apps. On VCDHelp, there are guides you can check out:
http://www.vcdhelp.com/edit

@^^-+I4004+-^^ this is contradictory as ADVC captures to .avi files!
The encoding is done in the hardware(compressing to Canopus DV format) and takes places in the AVDC, where the audio is locked. When capturing in Windows with a separate card for audio and video, this is not the case. The resulting video from the ADVC is transferred to the harddrive using Firewire. Yes, it is avi, but the encoding took place in an environment where the audio was locked (in the AVDC). Exactly how locked audio works, I don't know yet. But I'm going to find out and judging by the many positive things I have read about the ADVC on this and other forums, I think it's the only way to go for me, personally.

or during playback only?obviously encoding problems exist.....
Assuming the Mpeg-2 file was encoded with an encoder that produces video and audio file that meets the specification for a Mpeg-2 compliant program stream, I *think* the problem lies in that DVD2avi cannot accurately read the data associated with keeping audio and video in sync. Perhaps Avisynth is involved in the problem too.

/Swan

Acceler8n
5th December 2002, 21:06
To Swan,

I think it might be my TV tuner card? Since other people have better success, and mostof them use other TV cards other than the AverMedia card that I have, can this be the problem? I just tried capturing with AverMedia software instead of PowerVCR and the results were similar.

When you capture with PowerVCR do do any custom settings to the frame? I captured with just I and P frames as recommended in an earlier post. Can this be the cause of the problem?

Swan
6th December 2002, 00:28
think it might be my TV tuner card? Since other people have better success, and mostof them use other TV cards other than the AverMedia card that I have, can this be the problem?
No, I don't think it is your card. The card you have is equipped with what is probably the most common analog to digital video converter chip on the consumer market, a BT878a, so you have the same chip as the majority of the population with a capture card. Aver's drivers could be to blame, but I doubt that since I have used them successfully. I personally used my Aver card for six months or more, both with their drivers and the alternate Btwincap (generic driver for Bt878 cards) and I did not experience the same amount of bad sync headaches as you. Mpeg to DivX can be tricky, but that the sync goes out when you edit a simple Mpeg-1 (VCD) file is odd.

But since your Mpeg-files play in perfect sync, unless you edit them with TMPGEnc or try to DivX encode them, I believe that you just need to find a better editing software. The key to solving this is finding the right editor and if this doesn't do the trick, trying a different capturing program.

If you want, I could examine and try to edit one of your files and see if I spot any problems with them. This would mean you'd have to send me a CD, but if you want, I'm willing to do this.
We can discuss this via mail, if you're interested.

When you capture with PowerVCR do do any custom settings to the frame? I captured with just I and P frames as recommended in an earlier post. Can this be the cause of the problem?
No, I seriously doubt that. And you have a new, spanking and fast computer, so that's not the issue either. Perhaps if you can send me a troublesome file via snail mail, I'll see what I can make of it.

/Swan

Acceler8n
6th December 2002, 01:01
Can the problem be the mpeg2 codec I have? Does this affect the encoding of mpeg files or does the capturing software do all the encoding? Also, for PowerVCR, is there any patch or update that I should've installed? ( I just patched it with the patch at their site)