2016-11-13, 01:27 AM
(This post was last modified: 2016-11-13, 03:53 PM by Chewtobacca.)
I'm posting this because:
Requirements
*original post*
- it got me into using AviSynth to sync and is something of an exemplar of how to do it;
- I think it's a little bit of scripting history.
Requirements
- the latest version of AviSynth
- SoundOut and NicAudio plugins
- the audio track from the MGM BD in PCM format (which can be generated by eac3to)
*original post*
Code:
/*
* GBUDub.avs
*
* This script generates a synced English dub for the
* Italian Blu-ray release of "The Good, the Bad, and
* the Ugly" out of the audio track of the MGM Blu-ray.
*
* Input file:
* PCM (big endian) format, 48kHz/24 bit, 6 channels
* runtime 02:58:41
*
* The runtime of the output file should be 02:54:23.
*
* "Rigby Reardon" @ AVSForum, 2009-10-18
*/
# Replace with your own filename here
au0 = NicLPCMSource("d:\video\GBU\gbu_6ch.pcm", 48000, -24, 6)
bl0 = BlankClip(length=256135, fps=24000, fps_denominator=1001, \
channels=6, audio_rate=48000, sample_type="24bit")
av0 = AudioDub(bl0, au0)
Trim(bl0, 0 , 413 ) ++ \
Trim(av0, 312 , 4237 ) ++ \
Trim(av0, 4254 , 18251 ) ++ \
Trim(av0, 18253 , 27442 ) ++ \
Trim(av0, 27441 , 35469 ) ++ \
Trim(av0, 35469 , 35796 ) ++ \
Trim(av0, 35796 , 40375 ) ++ \
Trim(av0, 40378 , 55111 ) ++ \
Trim(av0, 59854 , 66116 ) ++ \
Trim(av0, 66109 , 75416 ) ++ \
Trim(av0, 75418 , 76166 ) ++ \
Trim(av0, 76168 , 91535 ) ++ \
Trim(av0, 91534 , 94950 ) ++ \
Trim(av0, 94950 , 118982 ) ++ \
Trim(av0, 118974 , 124891 ) ++ \
Trim(av0, 124891 , 141569 ) ++ \
Trim(av0, 141569 , 147641 ) ++ \
Dissolve( \
Trim(av0, 149245 , 149536 ), \
Trim(av0, 147643 , 148134 ), 10 \
) ++ \
Dissolve( \
Trim(av0, 148132 , 148324 ), \
Trim(av0, 148321 , 149145 ), \
Trim(av0, 150217 , 150497 ), \
Trim(av0, 150490 , 150710 ), \
Trim(av0, 150705 , 150791 ), \
Trim(av0, 150787 , 151022 ), \
Trim(av0, 149522 , 149805 ), \
Trim(av0, 151029 , 151406 ), \
Trim(av0, 151396 , 151510 ), 2 \
) ++ \
Dissolve( \
Trim(av0, 151510 , 152091 ), \
Trim(av0, 149792 , 150237 ), \
Trim(av0, 152075 , 152492 ), 20 \
) ++ \
Dissolve( \
Trim(av0, 152583 , 152921 ), \
Trim(av0, 152984 , 154010 ), 2 \
) ++ \
Trim(av0, 154010 , 163697 ) ++ \
Trim(av0, 163699 , 168009 ) ++ \
Trim(av0, 168009 , 168723 ) ++ \
Trim(av0, 168723 , 175351 ) ++ \
Trim(av0, 175351 , 176293 ) ++ \
Trim(av0, 176284 , 211334 ) ++ \
Trim(av0, 211337 , 223241 ) ++ \
Trim(av0, 223240 , 224481 ) ++ \
Trim(av0, 224480 , 234857 ) ++ \
Trim(av0, 234859 , 244119 ) ++ \
Trim(av0, 244116 , 244155 ) ++ \
Trim(av0, 244155 , 244722 ) ++ \
Trim(av0, 244724 , 245819 ) ++ \
Trim(av0, 245821 , 249585 ) ++ \
Trim(av0, 249974 , 253861 ) ++ \
Trim(av0, 253890 , 256134 ).FadeOut0(240)
SoundOut()
# End of script