Log in

View Full Version : Audio Shrinking?


n0an
31st August 2009, 00:37
Hello,

Is it possible to shrink audio as per the duration of the video? For some reason the audio is longer than the duration of the video.

I tried changing FPS using BeSweet, but that changes the pitch of the audio. Voices become really heavy. Any way of shrinking the audio as per the duration of the video?

Video: 1:42:16 @ 25.000 FPS
Audio: 1:42:22

The audio keeps getting delayed every 'x' seconds by itself. How to fix this?

Thanks!

setarip_old
31st August 2009, 00:48
Hi!

What is the format of the file?

2) What is the format of the video?

3) What is the format of the audio?

4) What is the original source material?

5) How did you manage to create the file so that the video and audio lengths don't match? - Surely your original source material doesn't suffer from that problem...

6) What software and procedures did you use to create this problematic file?

n0an
31st August 2009, 00:57
Oh yea... I forgot to mention those things. My bad!

1. Video: AVI
2. Audio: MP3
3. Video: Movie DVD9 dubbed in Chinese.
Audio: English audio from the VCD release.

I am trying to put VCD English audio on the DVD quality video.

5. I encoded the video to 25.000 FPS AVI and then tried syncing the audio. Source video was at 29.970.

6. I didn't create the file. I extracted audio from the VCD version of movie. I used BeSweet to change the FPS, but it changes the pitch instead.

Any way of auto-adjusting audio as per the video duration? Like we do it for the subtitles :P.

setarip_old
31st August 2009, 01:14
(The DVD video was at either 29.970fps or 23.976fps - not 29.976fps)

Load the (.AVI) file into VirtualDub, VirtualDubMod, or NanDub.
Set BOTH "Video"(VirtualDub,
VirtualDubMod and NanDub) and "Audio"
(VirtualDub and NanDub - VirtualDubMOD>"Streams>"Stream
list") to "Direct Stream Copy".

A) If the difference between audio and video is constant
throughout the video:

From the "Audio" dropdown menu, select "Interleaving" (For
VirtualDubMOD, rightclick on the listed audiostream and then
select "Interleaving")

Under "Audio skew correction", set an appropriate number of
milliseconds (positive or negative) in the box labelled "Delay
audio track by"

Save with a new filename

B) If the difference increases as the movie plays:

From under the "Video" dropdown menu, select "Framerate" -
and select "Change so video and audio durations match"

Save with a new filename.

Let us know of your success ;>}

n0an
31st August 2009, 01:27
It's the Case B here. I set "Change so video and audio durations match", but that doesn't help much. It still is OOS by a few ms. So, I tried cutting the video scene by scene and and then syncing(-ve delay) as the the delay increases with time. It's really hard as the delay increases every 20 secs or so.

MatLz
31st August 2009, 02:18
Hi n0an.
I suggest you to use the 'time stretch' filter in vdub.
But the audio must matche perfectly in the begining.
Vdub:
Audio
Audio from other file (choose your mp3)

Audio
use advanced filtering
filters:
In the order, add:
Input-time stretch-output
Close the addwindow
Doubleclick on time stretch and write 0.99938411 (for more precision divise the real times with the ms)
When done, choose your format and bitrate and save the all.

n0an
31st August 2009, 07:51
Thanks for the suggestion, but how to determine the ratio? Did you calculate "0.99938411" as per the durations given in the OP or just a standard guess? I'm using stretch. I believe, you referred to it as "time stretch". Am I right?

The movie is being processed. Will post back if I have any doubt(s).

P.S. I am on VirtualDubMod. Is VirtualDub preferred for syncing or doesn't make a difference?

Update

Doesn't work. It's still out of sync - gradual increase in delay.

MatLz
31st August 2009, 15:14
Ok.
Length of your video:
2h42min16s -> 9736s
Length of your audio:
2h42min22s -> 9742s

9736/9742=0.99938411

If it doesn't work, adjust manualy the ratio and click on the second play button for previewing and adjusting(I forgot to tell you that!) And don't use interleaving in vdub for sync a/v in the begining, use an audio tool for that (mp3dc, audacity...)

n0an
31st August 2009, 19:54
The starting of audio and video is from starting production credits. They match in the beginning, but then they gradually go OOS. I tried the ratio, but didn't work. Can you teach me how to interleave properly in this case? I always fail to calculate the correct interleaving per ms or per frame.

I can keep on (-)delaying the audio as per the correct period of (+)delay per certain frames or MS. How to calculate both of them?

setarip_old
31st August 2009, 20:49
Please load the FIRST .AVI that you created into GSpot - and then post screenshots showing video and audio info back here...

n0an
31st August 2009, 23:05
GSPot

http://i27.tinypic.com/35mjssn.jpg

MediaInfo

General
Complete name : C:\DVD-VCD-test\test1.avi
Format : AVI
Format/Info : Audio Video Interleave
Format profile : OpenDML
File size : 1.01 GiB
Duration : 1h 42mn
Overall bit rate : 1 413 Kbps
Writing application : AVI-Mux GUI 1.17.7, Aug 8 2006 20:59:17

Video
Format : MPEG-4 Visual
Format profile : Streaming Video@L1
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default
Muxing mode : Packed bitstream
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 1h 42mn
Bit rate : 1 250 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 1.500
Frame rate : 25.000 fps
Standard : NTSC
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.145
Stream size : 914 MiB (88%)
Writing library : XviD 1.2.1 (UTC 2008-12-04)

Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 1h 42mn
Bit rate mode : Constant
Bit rate : 160 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 117 MiB (11%)
Alignment : Aligned on interleaves
Interleave, duration : 1200 ms (29.99 video frames)
Interleave, preload duration : 216 ms
Title : English-VCD-Audio

MatLz
31st August 2009, 23:20
Your video have lost 1h ????
In your first post it was 2h42!

setarip_old
1st September 2009, 01:27
Based on your screen capture:

1) You should try setting the Video fps to 23.976 (NTSC with pulldown removed - the video IS NTSC at 720x480)

2)I see no reason why using the standard VirtualDub to "Change so video and audio durations match" shouldn't work perfectly

3) What is the title and Region number of the original, commercial DVD?

n0an
1st September 2009, 01:41
@MatLz: Oh, I had mistyped the duration there. I am sorry about that.

@setarip: It would take me a lot of time to encode the video again. My laptop is slow and takes a lot of time. Any way of squeezing the audio by 6 secs? Splitting the end 6 seconds might make it easier. What say?

tebasuna51
1st September 2009, 09:44
... Any way of squeezing the audio by 6 secs? Splitting the end 6 seconds might make it easier. What say?

You need search two points (shots, door closed, ... use VirtualDub for video, Audacity for audio) and use the method:

Syncronize audio with two coincident points.

We need found two points, at begining and at the end of the movie and annotate the times (in seconds):
- First point occurs at 'tv1' in video part and 'ta1' in audio part.
- For point two, times 'tv2' and 'ta2'.

If the delay is constant and/or progressive we need a constant part 'D' and a progressive part 'K' to sync:
tv1 = K x (D + ta1)
tv2 = K x (D + ta2)
Then:
K = (tv2 - tv1) / (ta2 - ta1)
D = (tv2 / K) - ta2

We can use an audio editor to make the job or you can use a AviSynth script like:
DelayAudio( D )
TimeStretch(tempo= 100.0 / K)

With BeSweet use the 'tempo' method to avoid pitch changes.

burfadel
1st September 2009, 13:38
Open the audio file in Goldwave www.goldwave.com

Its a essentially a free programme, its ideal for what you want.

Open the audio file, click on Effect --> Time Warp, then click the 'FFT' tab, select 'Oscillator Synthesis', FFT of say, 13, and then change the length to the exact length that you want. That should give you an adjusted audio length whilst maintaining audio pitch and quality. You may have to see how toggling the oscillator synthesis button and changing the FFT between 12 and 14 will do for you.

n0an
2nd September 2009, 20:18
@tebasuna: I have no idea how to do that. How do I find those points? After I find them how do I use them?

@burfadel: I did exactly what you said, but didn't work. The audio length came down to 1:42:10 and still OOS. It still has the gradual delay and ends the audio 6 seconds earlier than the 16s mark. I had entered the exact length of the video(01:42:16.640), but...

http://i30.tinypic.com/v6q34g.jpg

There's no option higher than 12 for FFT size. It gives an error on manually increasing the value.