Skip to content

Commit 5d985b9

Browse files
author
feos
committed
use better fix for av desync taken from http://tasvideos.org/EncodingGuide/HybridEncodeScript.html
1 parent 5f2225c commit 5d985b9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

encode.avs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ subString2 = "Playing time: " + time \
7676
subString3 = "This is a tool-assisted recording." \
7777
subString4 = "For details, visit http://TASVideos.org/"
7878

79+
# Fix progressing (not floating) audio/video desync
80+
avDesyncFixer = false
81+
7982
################
8083
# LEGACY STUFF #
8184
################
@@ -107,9 +110,6 @@ audio = \
107110
WavSource("dspdump.wav")
108111
*/
109112

110-
# Fix progressing (not floating) desync
111-
# AssumeFPS(last.FrameCount / last.AudioLengthF * last.AudioRate)
112-
113113
######################
114114
# AUTOMATED SETTINGS #
115115
######################
@@ -128,6 +128,13 @@ hdvb = hd && vb
128128
# Make too dark scenes brighter
129129
# AutoLevels(filterRadius=1000, sceneChgThresh=200, gamma=1.1)
130130

131+
# Fix progressing (not floating) audio/video desync
132+
num = last.AudioLengthF * last.FrameRateNumerator
133+
denom = last.FrameCount * last.FrameRateDenominator
134+
avDesyncFixer ? AssumeSampleRate(Round(num / denom)).ResampleAudio(48000) : 0
135+
# Alternative method that tweaks framerate instead (not recommended)
136+
# avDesyncFixer ? AssumeFPS(last.FrameCount / last.AudioLengthF * last.AudioRate) : 0
137+
131138
# VirtualBoy (bizhawk only!)
132139
# http://tasvideos.org/forum/viewtopic.php?p=435440#435440
133140
left = vb ? Crop( 0, 0, 384, 224).Levels(0, 1, 255, 0, 157) : 0

0 commit comments

Comments
 (0)