PDA

View Full Version : MPG to DivX 5 - sync problem...


Prizm
20th May 2003, 06:14
The newer MPG episodes of Smallville (like episode 19 and 22) are screwed up somehow. They play fine as MPG, but when converted to DivX, they start out in sync but end up extremely out of sync near the end of the episode. Not only that, but the video doesn't seem as smooth as it should be.

I have tried converting using Graph Edit, MPEG Mediator, and VirtualDub, but all produce the same problem. I'm using DivX 5.02.

I have tried using AVI Info to 'stretch' the audio, but it didn't seem to work either.

Anyone have any ideas?

Prizm

mldragon
20th May 2003, 07:13
Do you mean the audio and vedio are not played in coordinate?

I suggest you get the audio full-process(in virtualdub) so to re-codeced the audio and video at the same time.

Prizm
20th May 2003, 07:31
Yeah, the audio and video goes out of sync.

Yes, I am encoding both audio and video at the same time. The video comes out as DivX 5.02, and the audio is automatically converted to WAV. But the sync problem is there.

I have done MPG to AVI many times with no problems, so I don't think it is my fault.

Prizm

mldragon
20th May 2003, 10:40
How do you convert the mpeg audio into wav?
At lease in virtualdub Audio full process mode I only find to convert the audio into Mpeg-layer3(in Compression menu).If in the menu it does not display the Mp3 preference, try to install divx3.11.

My experience is sometimes virtualdub will say that the audio stream is a kind of VBR(Not remember exactly) so it would screw up. And I convert the audio into Mp3, it's OK.

Maybe you should have a try.Or try to use another codec(like Xvid) to see whether the trouble-maker really is the divx5.02.

mtrooper
20th May 2003, 14:13
Try (in VirtualDub) Video->Frame rate and select "change so video and audio durations match". That will give you synch & also a weird frame rate.

If you want a more normal frame rate then you should stretch only audio.

There was also a discussion about it VirtualDub forum: http://forum.doom9.org/showthread.php?threadid=44897

Prizm
20th May 2003, 16:07
Originally posted by mldragon
How do you convert the mpeg audio into wav?
At lease in virtualdub

I don't think I have in VirtualDub...if I use VirtualDub, then I do File | Save WAV... - and that saves the MPG audio as a WAV file. Then I re-insert the WAV/MP3 later.

But with Graph Edit and MPEG Mediator, it automatically converts to WAV when you convert the video.

I will try the frame rate thing in VirtualDub and see how I go - thanks mtrooper.


Prizm

TelemachusMH
20th May 2003, 17:55
Your problem isn't with virtualdub or how you're converting it. Most mpgs in situations like this have broken frames where the person who captured it did something on their computer while it was recording, and the capture program didn't have enough time to finish encoding a video frame or two but it still captures the audio. When you play the mpg there is no problem because when it gets to the broken frame as much as possible is played, and the rest is skipped and the video is paused for a part of a frame.
The problem is when you import this into virtualdub. VirtualDub can't decode frames that aren't there, and they are skipped because of that. So, if there are many broken frames, you will get a sync issue that you can't solve with delays.

What you need to do is run the mpg through: dvd2avi->AviSynth->VirtualDub. This fixes the problem (I've done this several times, for freinds.) (I think dvd2avi skips both the audio and video frames that are broken, so no more sync issues)

TelemachusMH

Prizm
21st May 2003, 06:07
Originally posted by TelemachusMH
What you need to do is run the mpg through: dvd2avi->AviSynth->VirtualDub. This fixes the problem (I've done this several times, for freinds.)

Ok, now I'm lost. I understand where you're coming from about corrupt frames - but DVD2AVI doesn't open up MPG. So how do you do it?

Prizm

jggimi
21st May 2003, 14:29
Actually it will open .mpg files with MPEG-2 streams. You just have to point at them manually.

Prizm
21st May 2003, 17:41
Originally posted by jggimi
Actually it will open .mpg files with MPEG-2 streams. You just have to point at them manually.

But these are not MPEG2s. They're MPEG1s, TV rips of Smallville.

I have been searching everywhere for a solution to this. Someone mentioned encoding the MPG again, and then converting it to DivX. Will converting it to MPG again affect the quality that much? Can I set a high bitrate for the new MPG?

Prizm

TelemachusMH
22nd May 2003, 19:20
If you set a high enough bitrate to max out the stream you should be able to minimize the loss in quality.

Also, DVD2AVI accepted the videos when I tried it. It didn't give me a preview, but it made the project file just fine.

TelemachusMH

Teegedeck
23rd May 2003, 00:00
I have no idea why, but many MPEGs seem to have video-streams longer than the audio-streams. Somehow MPEG is a strange container, no idea how it works... Anyway, the only solution I know is: decompress the mp2 to a wav, then remux it with VirtualDub 1.52, set the video to 'direct stream copy' but use 'full processing' for the audio and 'advanced filtering'. Add an input, the stretch and output filter and connect them. Divide the length of video by the length of the audio track, which should give you value just slightly above '1'. Configure the stretch filter and enter that value. Save the file and check that the sound is now in synch. If it is you can demux the wav, compress it and remux again. :rolleyes:

Instead of using VDub 1.52 for it, you could also use shareware audio editors like the 'amazing slow-downer' - but I haven't tested that myself.

mnd
28th May 2003, 14:21
Hi!
You may also try Xmpeg. http://www.mp3guest.com/Xmpeg_Index.asp?l=US

I convert with it my TV capture without noticeable sound syncho issue.
In only one launching you obtain an avi file with MP3 audio.

You can also suppress in the same passage the commercial advertising thanks to the scene selection facility.

In this case Xmpeg create one file by scene you simply merge with Virtualdub thanks to the Append Avi Segment option

Panzerfather
10th June 2003, 00:53
Ya, or try the MPEG Mediator (Special Edition) to convert these MPEG1 Files to AVI !

Why does the "normal" MPEG Mediator creates a AUDIO/VIDEO SYNC failure ? Do you probably tried it with DIVX 5.05 ?