Username:
B
I
U
S
"
url
img
#
code
sup
sub
font
size
color
smiley
embarassed
thumbsup
happy
Huh?
Angry
Roll Eyes
Undecided
Lips Sealed
Kiss
Cry
Grin
Wink
Tongue
Shocked
Cheesy
Smiley
Sad
12 ->
--
--
List results:
Search options:
Use \ before commas in usernames
Ben Goldberg
I compressed a file with Divx, and the sound is like a half second off! What gives?
Thread title:  
I love YaBB?! Hell no.
sure your media player doesn't mess with stuff?
Retired
Did you compress the audio?  Did the sample rates match? If not, did you use a conversion?
Ben Goldberg
Nevermind my first question, I have a new problem now. I was editing a AVI file with virtualdub and i cut out a little section at the beginning of the AVI. I go and watch it and the sound is off, I didn't save it or anything, all i did was delete a little section and the sound goes way off. Anyone know what to do about this?
Is the sound coming from an external WAV? If so, you need to save the two together before you do any editing, otherwise the cuts will only affect the video...
Ben Goldberg
Nope, it's all normal, original sound and all.
Mumma
If the audio was encoded as a VBR (variable bit rate) MP3 then that would explain the desynch. Make sure you didn't try to use VBR. If you did, you'll have to re-encode the audio and mux it in with the video. Simple job if you know your way around virtualdub.

If the audio stream is a nice CBR (constant bit rate) one, you could try and multiplex the video and audio again, simply telling vdub to use a delay for the audio. I don't have the program in front of me now, but there should be something called "interleave options" or so in the audio menu. Use this to specify a number of milliseconds you want to delay the audio track. Negative values makes the sound come earlier, positive values delays it. Then select direct stream copy for the video and save as.

But, I agree with Tuntis. Try the AVI in several media players first. It might be your standard player screwing with you. May I suggest you try mplayer2, it's already in your system. Just type mplayer2 at the Run... prompt.

The never-fail workaround to your second problem is to demux the audio from the AVI, cut out the desired region, encode it and mux it with the video to make a nice, synchronizsed AVI again.
Ben Goldberg
I watched it on both WMP and the virtualdub preview window and it lagged on both. I'll try messing around with making the sound come earlier though. It's all on sync until I edit it.
Ben Goldberg
This is horrible, I'm having problems all around. I was editing the video, and it lagged real real bad. I also saved it both as an AVI and original AVI, and it also doubled the file size, and still lagged real bad. All I'm doing is cutting a little section out at the beginning, and the same with the end, and it's giving me huge problems.
The only other thing I can think of is the VBR issue that Mandel mentioned. The reason the filesize doubled(probably) is because the audio(probably MP3) was converted to WAV. It would seem then that the problem is with the codec that's doing the conversion.

Try extracting the audio(File->Save WAV); open it with whatever audio program you prefer that can convert between formats. WinAmp should work(Options->Preferences->Plug-ins->Output and select waveOut; playback the file). That should leave you with a clean WAV file.

Back to VirtualDub: open the unaltered video; Audio->WAV Audio and select the converted file(make sure Video->Direct Stream Copy is selected); save as a new file. Now try editing this new video file.

Hope that works, because I'm about out of ideas...
Edit history:
Cygnus: 2005-02-25 04:08:18 am
Ben Goldberg
I've been doing some test and I looked at a file I compressed with Divx a long time ago, and I was looking, and the sound was a whole second off. You can clearly see it's way off, but I've seen the file before, and I don't remember it being off at all. I could of missed it, but it's really obvious. Is there any chance that it could be something my computer is doing to it. I tried playing it on more than one video player, and it still was the same. Also, I checked out some other files coded in Divx (from other people), but they were fine.

So if anyone knows if this could be the problem, I'd like to know. I think I'm going to have someone else watch a video I encode and see if it's only me. I just wish I didn't have these problems, cause I need to get rid of these huge files as fast as I can.
I'm addicted to games
You do realize that divx has nothing to do with sound I hope. Divx compresses the video only. The recomended sound encoding from Nate and me is lame mp3, listed at http://faq.metroid2002.com/
Ben Goldberg
But could it make the sound go out of sync? Cause if not, that helps me out a lot right there. It means all of these problems I'm having are with my computer, and not with Divx and virtualdub.
Okay, let's start from the top. Give us all the info...

The original file: what video codec is used? What audio codec is used(and at what bitrate, sampling frequency, stereo/mono, etc.)?

When recompressing, what are your video and audio settings(exactly)? What version of DivX are you using? Also, the older file you said was now desyncing, what audio codec does it use?

I can't see how DivX would cause the desyncing issue, but VirtualDub certainly can if you're not careful.
Ben Goldberg
Alright, I'm not too good with this stuff, yet, so... I'll try to explain this as best I can.

-The original file: what video codec is used? What audio codec is used(and at what bitrate, sampling frequency, stereo/mono, etc.)?

I compressed it with Dr. Divx and I did not compress the audio. I just left all of the default settings.

-When recompressing, what are your video and audio settings(exactly)? What version of DivX are you using? Also, the older file you said was now desyncing, what audio codec does it use?

All default. I used the newest version of Dr. Divx.
Okay, I assumed you were doing all of this from inside VirtualDub(I've never used Dr. DivX). Step by step...

1. Open the original, properly sync'd file in VirtualDub.
2. Go to File->File Information, which should bring up the following window...



3. From the video side, give me Frame Size, fps and Decompressor.
4. From the audio side, give me Sampling Rate, Channels, Sample Precision, Compression and Data Rate.

This is all the critical information...
Ben Goldberg
Ok, this is the information from the original, uncompressed AVI.

Frame Size-320x240
fps-29.970
Decompressor-YUV 4:2:2 (YUY2)
Sampling Rate-44100Hz
Channels-2 (Stereo)
Sample Precision-16 bit
Compression-PCM (Uncompressed)
Data Rate-1411 kbps (0.03% overheat)

I hope this helps.
Awesome. Now...

1. Open this file in VirtualDub.
2. Without changing any settings, make the edits you want.
3. Save As a new file.

Is the new file out of sync? If it is, give me the same stats on this file...
Ben Goldberg
Before I do this, which option exactly do I choose. Like....

Save as AVI
Save old format AVI
Save segmented AVI
ext...
Save as AVI
Ben Goldberg
Same thing happened. Almost doubled in size, and way way laggy. I mean way laggy. Not watchable at all. Hmm, here are the stats for it....

Frame Size-320x240
fps-29.970
Decompressor-Uncompressed RGB24
Sampling Rate-44100Hz
Channels-2 (Stereo)
Sample Precision-16 bit
Compression-PCM (Uncompressed)
Data Rate-1411 kbps (0.03% overheat)

I did nothing but deteted some parts out. Why why why?
I'm addicted to games
You converted the video from YUY2 to RGB24. YUY2 is 16 bit and RGB24 is 24 bit, therefore 50% larger. This made the video so big that it can't be read off your hard drive fast enough to play it. You should be using huffyuv for all intermediate operations on a file. See nate's faq.
Too weird. What are the audio lengths of the two AVIs(under the audio portion of the example I posted; specifically the Length field)?

Another experiment:

1. Open the original in VirtualDub.
2. Without changing any settings(or editing it) "Save as AVI" to a new file.

The resulting file should still be in sync. If it's not, give me the Length(from the video portion of my example) of both. This should tell us whether the audio or the video is getting cut.
Ben Goldberg
Ill try that out Andy. But Radix, where would I find Nate's faq? And does that tell me how to stop it from changing from YUY2 to RGB24 automatically? I did not do that, it did it itself.
I'm addicted to games
I gave the link earlier in the thread. If you use huffyuv there's no problem with yuy2/rgb24.