Advertisement
Guest User

Trying to encode PSXawk

a guest
Jan 28th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.44 KB | None | 0 0
  1. # The downloadable/HD encoding script. For more information, see:
  2. # http://tasvideos.org/EncodingGuide/PublicationManual.html
  3. # Script updated 26.10.2015
  4.  
  5. AVISource("movie.avi", "movie_2.avi", "movie_3.avi").LanczosResize(378, 240)
  6.  
  7. # AppendSegment("movie.", 1, 8, "%02.0f") # multisegment import
  8. # string format: "02" means pad with zeros up to 2 digits
  9. # audio = WavSource("movie_000.wav") # psxjin
  10. # AudioDub(audio, last) # psxjin
  11.  
  12. ConvertToRGB32()
  13. trimframe = 238915 # manual, discards logo lengh automatically
  14. handheld = false # auto, but set it for preview
  15. hd = false # auto, but set it for preview
  16. halffps = false # for games that "lag" every other frame
  17. stackNDSscreens = false # stack one of NDS screens near both of them for HD
  18. BizhawkPSX = false # don't downscale PSX BIOS for youtube:
  19. # picks the first 4 avi segments as bios screen
  20. # use the rest as usual encode
  21.  
  22. # Subtitles contents
  23. game = "Oddworld: Abe's Oddysee"
  24. branch = "'100%'" # lowercase for usual words, capital for in-game capital words. when blank, leave "''"
  25. author = "Samtastic"
  26. time = "1:05:01.65"
  27. rerecords = "14949"
  28.  
  29. # Subtitles timing and placement
  30. subFF = 3696 # first subtitles frame, set manually!
  31. subAlign = 8 # subtitles alignment (7/8/9)
  32. subYpos = 0 # subtitles vertical position
  33. subLength = int(last.FrameRate * 5) # auto
  34.  
  35. # Deblink
  36. blend = false # compensate for 30 fps flickering at all. always check if the run requires it!
  37. ngdb = true # use smart deblink for that, otherwise will tasblend (avoid tasblend!)
  38.  
  39. # Crop(32,0,-32,0) # lowres genesis
  40. # Crop(0,0,-0,-20) # old mupen
  41. # ResampleAudio(last,44100) # old mupen
  42. # hd ? 0 : LanczosResize(342,256) # old mupen
  43. # hd ? 0 : LanczosResize(256,384) # hires desmume
  44. # AssumeFPS(last.FrameCount / last.AudioLengthF * last.AudioRate) # progressing desync
  45.  
  46. # Dolphin. remove /* and */ to uncomment
  47. # get values at http://tasvideos.org/forum/viewtopic.php?p=373299#373299
  48. /*
  49. M = 486000000
  50. F = 60
  51. k = 1
  52. N = 525
  53. b = 0
  54. D = (k * N + b) * floor(floor(M / F) / N) # don't edit this formula
  55. LoadCPlugin("./programs/timecodefps.dll")
  56. video = last.TimecodeFPS("timecodes.txt", fpsnum=M, fpsden=D)
  57. audio = WavSource("dspdump0.wav")+WavSource("dspdump1.wav").ResampleAudio(32000)+WavSource("dspdump.wav")
  58. */
  59.  
  60. ######################
  61. # AUTOMATED SETTINGS #
  62. ######################
  63.  
  64. LoadPlugin("./programs/ExactDedup.dll")
  65. LoadPlugin("./programs/mvtools2.dll")
  66. LoadPlugin("./programs/mt_masktools-26.dll")
  67.  
  68. pass = 0
  69. i444 = false
  70. desyncfixer = false
  71.  
  72. factor = hd ? (last.height >= 1440) ? 1 : \
  73. (last.height >= 720) ? 2 : \
  74. (last.height >= 360) ? 4 : \
  75. 8 : 1
  76.  
  77. #file = "logo.png"
  78. file = hd ? stackNDSscreens ? "logohdnds.png" : \
  79. (last.height == 384) ? "logonds.png" : "hdlogo.png" : \
  80. (last.height == 384) ? "logonds.png" : "logo.png"
  81.  
  82. # This fixes length based audio/video desync,
  83. # if it exists inside the encode (eg. Many PCEngine games).
  84. num = last.AudioLengthF * last.FrameRateNumerator
  85. denom = last.FrameCount * last.FrameRateDenominator
  86. fixedaudiorate = Round(num / denom)
  87. (desyncfixer) ? last.AssumeSampleRate(fixedaudiorate) : 0
  88.  
  89. Trim(0, trimframe - int(last.FrameRate * 2))
  90. hd ? blend ? ngdb ? ng_deblink(0.5) : TasBlend() : 0 : 0
  91.  
  92. # Stack 3 NDS screens.
  93. UpperScreen = last.Crop(0, 0, -0, last.height/2)
  94. LowerScreen = last.Crop(0, last.height/2, -0, -0)
  95. HalfScreen = UpperScreen # set which NDS screen to place as main
  96. stackNDSscreens ? (hd ? StackHorizontal(HalfScreen.PointResize(last.width*2, last.height), last) : 0) : 0
  97.  
  98. b = last.PointResize(last.width * factor, last.height * factor)
  99.  
  100. # Aspect ratio correction
  101. width = (b.width > b.height * 4 / 3) ? b.width : b.height * 4 / 3
  102. width = (width % 4 == 1) ? width + 3 : \
  103. (width % 4 == 2) ? width + 2 : \
  104. (width % 4 == 3) ? width + 1 : width
  105. height = (b.width > b.height * 4 / 3) ? b.width * 3 / 4 : b.height
  106. height = (height % 4 == 1) ? height + 3 : \
  107. (height % 4 == 2) ? height + 2 : \
  108. (height % 4 == 3) ? height + 1 : height
  109.  
  110. c = handheld ? b : (hd ? b : b.LanczosResize(width, height, taps=2))
  111. g = hd ? c : ((pass == 0) ? c : last)
  112.  
  113. PSXbios = BizhawkPSX ? \
  114. AviSource("movie_0.avi").LanczosResize(g.width,g.height) + \
  115. AviSource("movie_1.avi").LanczosResize(g.width,g.height) + \
  116. AviSource("movie_2.avi").LanczosResize(g.width,g.height) + \
  117. AviSource("movie_3.avi").LanczosResize(g.width,g.height) : 0
  118.  
  119. # Logo.
  120. d = ImageSource( \
  121. file=file, start=0, end=int((last.FrameRate * 2) - 1), fps=last.FrameRate \
  122. ).ConvertToRGB32().AssumeFPS( \
  123. last.FrameRateNumerator, last.FrameRateDenominator)
  124. e = BlankClip(d, audio_rate=last.AudioRate, channels=last.AudioChannels)
  125. f = AudioDub(d, blankclip(g)).LanczosResize(g.width, g.height, taps=2)
  126. last = BizhawkPSX ? (f ++ PSXbios ++ g) : (f ++ g)
  127.  
  128. # Subtitles variables
  129. subSize = (last.width <= 240) ? 10 : 12
  130. subFF2 = SubFF + subLength + 1
  131. subString1 = game + "\n" + ((branch == "''") ? "" : (branch + "\n")) \
  132. + "Played by " + author + "\nPlaying time: " \
  133. + time + "\nRerecord count: " + rerecords
  134. subString2 = "This is a tool\nassisted recording.\nFor details, visit\n" + \
  135. "http://TASVideos.org/"
  136. subDividend = (last.width > last.height) ? last.height : last.width
  137. subFactor = (subDividend / 240 < 1) ? 1 : subDividend / 240
  138. subXpos = (subAlign == 7) ? (2 * factor) : \
  139. (subAlign == 8) ? last.width / 2 : \
  140. last.width - (2 * factor)
  141.  
  142. # Subtitles function
  143. hd ? ng_bighalo( \
  144. subString1, x=subXpos, y=(subYpos * subFactor), \
  145. align=subAlign, first_frame=subFF, last_frame=(subFF + subLength), \
  146. size=(subSize * subFactor), text_color=$00FFFFFF, halo_color=$00000000, lsp=2 \
  147. ) : subtitle( \
  148. subString1, x=(subXpos * factor), y=(subYpos * subFactor), \
  149. align=subAlign, first_frame=subFF, last_frame=(subFF + subLength), \
  150. size=(subSize * subFactor), text_color=$00FFFFFF, halo_color=$00000000, lsp=2 \
  151. )
  152.  
  153. hd ? ng_bighalo( \
  154. subString2, x=subXpos, y=(subYpos * subFactor), \
  155. align=subAlign, first_frame=subff2, last_frame=(subff2 + SubLength), \
  156. size=(subSize * subFactor), text_color=$00FFFFFF, halo_color=$00000000, lsp=2 \
  157. ) : subtitle( \
  158. subString2, x=(subXpos * factor), y=(subYpos * subFactor), \
  159. align=subAlign, first_frame=subff2, last_frame=(subff2 + SubLength), \
  160. size=(subSize * subFactor), text_color=$00FFFFFF, halo_color=$00000000, lsp=2 \
  161. )
  162.  
  163. halffps ? hd ? 0 : SelectOdd : 0
  164.  
  165. # Downloadable encodes need a resizing filter for the colourspace reduction.
  166. # HD encodes need to be point resized to keep the colour information faithful.
  167. ConvertToYV24(chromaresample="point", matrix=(hd ? "Rec709" : "PC.601") )
  168. (pass == 1) ? ExactDedup(firstpass=true, \
  169. dupinfo="./temp/dup.txt", \
  170. times="./temp/times.txt" \
  171. ) : last
  172. (pass == 2) ? ExactDedup(firstpass=false, dupinfo="./temp/dup.txt") : last
  173. i444 ? last : ConvertToYV12( \
  174. chromaresample=(hd ? "point" : "lanczos"), \
  175. matrix=(hd ? "Rec709" : (pass == 0 ? "Rec601" : "PC.601")) \
  176. )
  177.  
  178. ####################
  179. # CUSTOM FUNCTIONS #
  180. ####################
  181.  
  182. # Multisegment AVI import
  183. function AppendSegment(
  184. \ string base,
  185. \ int first_val,
  186. \ int last_val,
  187. \ string format
  188. \){
  189. AviSegment = base + String(first_val, format) + ".avi"
  190. result = Eval("AviSource(AviSegment)")#.LanczosResize(256,224)")
  191. return (first_val < last_val) \
  192. ? result + AppendSegment(base,first_val+1,last_val,format) \
  193. : result
  194. }
  195.  
  196. # nanogyth's deblink.
  197. function ng_deblink(clip clp,
  198. \ float "ratio",
  199. \ int "level",
  200. \ clip "blinkmask"
  201. \){
  202. #Version 10 2012.04.22
  203.  
  204. blink = default(blinkmask, clp.ng_blinkmask())
  205.  
  206. ratio = default(ratio, 2.0 /3)
  207. assert(ratio >= 0.0 && 1.0 >= ratio,
  208. \ "[ng_deblink] 1.0 >= ratio >= 0.0, it was " + string(ratio))
  209.  
  210. level = default(level, round(ratio * 257))
  211. assert(level >= 0 && 257 >= level,
  212. \ "[ng_deblink] 257 >= level >= 0, it was " + string(level))
  213.  
  214. m01=mt_logic(blink.SelectEvery(4,0),
  215. \ blink.SelectEvery(4,1),
  216. \ mode="or").ConvertToRGB32()
  217. m23=mt_logic(blink.SelectEvery(4,2),
  218. \ blink.SelectEvery(4,3),
  219. \ mode="or").ConvertToRGB32()
  220.  
  221. f0=Layer(clp.SelectEvery(4,0),
  222. \ clp.SelectEvery(4,1).Mask(m01),
  223. \ level=level)
  224. f1=Layer(clp.SelectEvery(4,1),
  225. \ clp.SelectEvery(4,0).Mask(m01),
  226. \ level=level)
  227. f2=Layer(clp.SelectEvery(4,2),
  228. \ clp.SelectEvery(4,3).Mask(m23),
  229. \ level=(257-level) )
  230. f3=Layer(clp.SelectEvery(4,3),
  231. \ clp.SelectEvery(4,2).Mask(m23),
  232. \ level=(257-level) )
  233.  
  234. Interleave(f0,f1,f2,f3)
  235. }
  236.  
  237. function ng_blinkmask(clip clp,
  238. \ bool "TEST",
  239. \ bool "STABILIZE",
  240. \ bool "SHARP",
  241. \ bool "HYSTER",
  242. \ int "inpand",
  243. \ int "expand",
  244. \ int "ml"
  245. \){
  246. #Version 10 2012.04.22
  247.  
  248. #BLINK
  249. # Blinking is a block that alternates on/off each frame
  250. # SelectEven would only see either the on or the off
  251.  
  252. #FLASH
  253. # Flashing is a block that is only on for a single frame
  254. # SelectEven might miss the flash
  255.  
  256. #SHAKE
  257. # Shaking is a block that moves back/forth each frame
  258. # SelectEven would only see one position
  259.  
  260. # The goal of this function is to make a blink mask for use with
  261. # ng_deblink. For overly complicated scenes where a clean blinkmask
  262. # can't be found, just use TASBlend. Uniform softness looks better
  263. # than sharp artifacts.
  264.  
  265. # This function calculates flash and shake info for the test script,
  266. # but those effects should be handled in different ways.
  267. # Flash - choose frames to make sure the flash is in your final clip.
  268. # Shake - SelectEvery(4,0,2,1,3) or SelectEvery(4,1,0,2,3)
  269. # SelectEvery doesn't generally work because it messes with the fluidity
  270. # of motion. But that won't be noticable on a shaking screen.
  271. # Be careful if 2 frame blinking is present, as the selectevery can turn
  272. # it into 1 frame blinking.
  273.  
  274. TEST = default( TEST, false)
  275. STABILIZE = default(STABILIZE, true)
  276. SHARP = default( SHARP, true)
  277. HYSTER = default( HYSTER, false)
  278. inpand = default( inpand, 1)
  279. expand = default( expand, 1)
  280. ml = default( ml, 128)
  281.  
  282. # The functions used to make the masks work in the YV12 colorspace. Once
  283. # the masks are created they can be used in the RGB32 colorspace direcly
  284. src=clp.ConvertToYV12()
  285.  
  286. # Blinking is located by looking for blocks that don't exist in
  287. # consecutive frames. The motion vector will match blocks that exist in
  288. # both frames. The blocks that aren't in both will end up with huge
  289. # values that are picked out by the motion mask.
  290. super = MSuper(src, pel=1)
  291. fvec = MAnalyse(super, isb=false, blksize=4)
  292. bvec = MAnalyse(super, isb=true , blksize=4)
  293. fmask = Mmask(src, fvec, kind=1, ml=ml).mt_binarize()
  294. bmask = Mmask(src, bvec, kind=1, ml=ml).mt_binarize()
  295. blink = mt_logic(fmask, bmask, mode="and")
  296.  
  297. # Blinking usually occurs against a stable background. This is found
  298. # by looking at blocks 2 frames apart. This distinguishes a blink from
  299. # blocks that are just changing every frame.
  300. ee_src = src.SelectEven()
  301. ee_super = MSuper(ee_src, pel=1)
  302. ee_fvec = MAnalyse(ee_super, isb=false, blksize=4)
  303. ee_bvec = MAnalyse(ee_super, isb=true , blksize=4)
  304. ee_fmask = Mmask(ee_src, ee_fvec, kind=1, ml=ml).mt_binarize()
  305. ee_bmask = Mmask(ee_src, ee_bvec, kind=1, ml=ml).mt_binarize()
  306.  
  307. oo_src = src.SelectOdd()
  308. oo_super = MSuper(oo_src, pel=1)
  309. oo_fvec = MAnalyse(oo_super, isb=false, blksize=4)
  310. oo_bvec = MAnalyse(oo_super, isb=true , blksize=4)
  311. oo_fmask = Mmask(oo_src, oo_fvec, kind=1, ml=ml).mt_binarize()
  312. oo_bmask = Mmask(oo_src, oo_bvec, kind=1, ml=ml).mt_binarize()
  313.  
  314. fmask_2 = Interleave(ee_fmask, oo_fmask)
  315. bmask_2 = Interleave(ee_bmask, oo_bmask)
  316. background = mt_logic(fmask_2.SelectEvery(1,1),
  317. \ bmask_2.SelectEvery(1,-1),
  318. \ mode="or")
  319. stable_blink = mt_hysteresis(background.mt_invert, blink)
  320. blink2 = (STABILIZE) ? stable_blink : blink
  321.  
  322. # Shrinking the blink mask can get rid of noise,
  323. # too much will lose signal as well.
  324. blink3 = blink2.mt_inpand(mode=mt_diamond(inpand))
  325.  
  326. # Using just pixels that changed helps sharpen the mask
  327. diff = ng_diff(clp.SelectEvery(1,-1), clp)
  328. diff_2 = mt_logic(diff, diff.SelectEvery(1,1), mode="and")
  329.  
  330. #Hysteresis
  331. # Matches continuous blocks of pixels.
  332. # Use with care, will match the whole screen on fades.
  333. hyster_blink = mt_hysteresis(blink3, diff_2)
  334.  
  335. # Expand the mask to make up for shrinking it (or just use hysteresis)
  336. blink4 = blink3.mt_expand(mode=mt_circle(expand))
  337. sharp_blink = mt_logic(blink4, diff_2, mode="and")
  338.  
  339. blink5 = (HYSTER) ? hyster_blink :
  340. \ (SHARP) ? sharp_blink : blink4
  341.  
  342.  
  343. # A flash won't match blocks 1 or 2 frames away.
  344. sub_flash = mt_logic(fmask_2, bmask_2, mode="and")
  345. flash = mt_logic(blink, sub_flash, mode="and")
  346.  
  347. # A shake changes in one frame and changes back in the next.
  348. # This isn't detected by the motion vectors because the blocks exist in
  349. # both frames, they are just shifting around.
  350. same = ng_same(clp.SelectEvery(1,-1), clp.SelectEvery(1,1))
  351. shake = mt_logic(same, diff_2, mode="and")
  352.  
  353. (TEST) ? stackhorizontal(clp, mergeRGB(blink5, flash, shake))
  354. \ : blink5.GreyScale()
  355. }
  356.  
  357. function ng_diff(clip A, clip B, int "thr"){
  358. thr=default(thr,0)
  359. TAD=ng_TAD(A,B)
  360. return mt_binarize(TAD, threshold=thr)
  361. }
  362.  
  363. function ng_same(clip A, clip B, int "thr"){
  364. thr=default(thr,0)
  365. TAD=ng_TAD(A,B)
  366. return mt_binarize(TAD, threshold=thr, upper=true)
  367. }
  368.  
  369. function ng_TAD(clip A, clip B){
  370. R=ng_AD(A .showRed("YV12"),B .showRed("YV12"))
  371. G=ng_AD(A.showGreen("YV12"),B.showGreen("YV12"))
  372. B=ng_AD(A .showBlue("YV12"),B .showBlue("YV12"))
  373. return ng_plus(R, ng_plus(G, B))
  374. }
  375.  
  376. function ng_AD(clip A, clip B){
  377. return mt_lutxy(A,B,"x y - abs")
  378. }
  379.  
  380. function ng_plus(clip A, clip B){
  381. return mt_lutxy(A,B,"x y +")
  382. }
  383.  
  384. # HD encodes need big subtitle fonts, but AviSynth can't enlarge the halo.
  385. # Here's the custom subtitle function by nanogyth
  386. # It's slow, but we have subtitles for a limited time only
  387. function ng_bighalo(
  388. \ clip clp,
  389. \ string text,
  390. \ float "x",
  391. \ float "y",
  392. \ int "first_frame",
  393. \ int "last_frame",
  394. \ string "font",
  395. \ float "size",
  396. \ int "text_color",
  397. \ int "halo_color",
  398. \ int "align",
  399. \ int "spc",
  400. \ int "lsp",
  401. \ float "font_width",
  402. \ float "font_angle",
  403. \ int "halo_radius",
  404. \ string "mode",
  405. \ string "halo",
  406. \ string "shadow"
  407. \){
  408.  
  409. #Version 16-17 2012/12/1
  410. # - added circle_12 as default
  411. # - reworked math to avoid bitwise functions that are only
  412. # availible in experimental builds
  413. #Version 15 2012/12/1
  414. # - drop shadow added
  415. # - halo_radius still works, but calculating the points of
  416. # a hollow circle for halo is much faster
  417. # - mode is depricated since memo-ing isn't as needed
  418.  
  419. first_frame = default(first_frame, 0)
  420. last_frame = default( last_frame, first_frame + 299)
  421. font = default( font, "Arial")
  422. size = default( size, 112)
  423. x = default( x, -1)
  424. y = default( y, -1)
  425. text_color = default( text_color, $00DDDDDD)
  426. halo_color = default( halo_color, $80000000)
  427. align = default( align, 5)
  428. spc = default( spc, 0)
  429. lsp = default( lsp, 0)
  430. font_width = default( font_width, 0)
  431. font_angle = default( font_angle, 0)
  432. shadow = default( shadow, "")
  433. w = clp.width
  434. h = clp.height
  435. ###
  436. ###
  437. ##
  438. #
  439. #
  440. #
  441. #
  442. #
  443. #
  444. #
  445. #
  446. #
  447. # #
  448. circle_12="0 0 "+\
  449. "12 0 0 12 -12 0 0 -12 "+\
  450. "1 12 2 12 3 11 4 11 5 11 6 10 7 10 8 9 "+\
  451. "12 1 12 2 11 3 11 4 11 5 10 6 10 7 9 8 "+\
  452. "-1 12 -2 12 -3 11 -4 11 -5 11 -6 10 -7 10 -8 9 "+\
  453. "-12 1 -12 2 -11 3 -11 4 -11 5 -10 6 -10 7 -9 8 "+\
  454. "-1 -12 -2 -12 -3 -11 -4 -11 -5 -11 -6 -10 -7 -10 -8 -9 "+\
  455. "-12 -1 -12 -2 -11 -3 -11 -4 -11 -5 -10 -6 -10 -7 -9 -8 "+\
  456. "1 -12 2 -12 3 -11 4 -11 5 -11 6 -10 7 -10 8 -9 "+\
  457. "12 -1 12 -2 11 -3 11 -4 11 -5 10 -6 10 -7 9 -8 "
  458. halo = (defined(halo_radius)) ? mt_circle(halo_radius) : circle_12
  459.  
  460. invis = BlankClip(1, w, h, pixel_type="YV12")
  461. tm = Subtitle(invis, text, x, y, 0, 0, font, size, $00FFFFFF,\
  462. 0, align, spc, lsp, font_width, font_angle)
  463. text_mask = tm.mt_expand(mode="0 0 "+shadow, chroma="-128")
  464. halo_mask = text_mask.mt_expand(mode=halo, chroma="-128")
  465.  
  466. h0 = halo_color%$01000000
  467. h_color = (h0>=0) ? h0 : $01000000+h0
  468. t0 = text_color%$01000000
  469. t_color = (t0>=0) ? t0 : $01000000+t0
  470. h_alpha = (halo_color>=0) ? 255-(halo_color/$01000000) : (-halo_color-1)/$01000000
  471. t_alpha = (text_color>=0) ? 255-(text_color/$01000000) : (-text_color-1)/$01000000
  472. lut_str = string(h_alpha)+ " x * 255 / " +string(t_alpha)+\
  473. " " +string(h_alpha)+ " - y * 255 / +"
  474.  
  475. alpha_mask = mt_lutxy(halo_mask, text_mask, lut_str)
  476.  
  477. hc = BlankClip(1, w, h, color=h_color)
  478. tc = Subtitle(hc, text, x, y, 0, 0, font, size, t_color,\
  479. 0, align, spc, lsp, font_width, font_angle)
  480. overlay = tc.Mask(alpha_mask.ConvertToRGB32())
  481.  
  482. clp.ApplyRange(first_frame, last_frame, "Layer", overlay)
  483. }
  484.  
  485. # TASBlend.
  486. function TASBlend(clip c, float "ratio") {
  487. # reduces framerate to 1/2 but leaves flicker effects partly visible
  488. # blends frame pairs with alternating opacity
  489. # The default for this is 2/3+1/3;1/3+2/3)
  490. # optional "ratio" is the opacity of the first frame out of the four
  491. ratio = default(ratio, 2.0 / 3)
  492. opacity1 = round((1 - ratio) * 257)
  493. opacity2 = round((ratio) * 257)
  494. c
  495. Interleave( \
  496. Layer(SelectEvery(4, 0), SelectEvery(4, 1), level=opacity1), \
  497. Layer(SelectEvery(4, 2), SelectEvery(4, 3), level=opacity2) \
  498. )
  499. }
  500.  
  501. # Replace for partial blending.
  502. function Replace(clip c, int i, int j, clip d) {
  503. Assert(i >= 0, "Replace: parameter i is negative")
  504. Assert(j >= 0, "Replace: parameter j is negative")
  505. p1 = c.Trim(0, -i)
  506. p2 = d.Trim(i, j)
  507. p3 = c.Trim(j + 1, 0)
  508. p1 = (i == 0) ? c.Trim(0, -1).DeleteFrame(0) : p1
  509. p3 = (j == 0) ? c.Trim(0, -1).DeleteFrame(0) : p3
  510. p1 + p2 + p3
  511. return (c.HasAudio) ? last.AudioDub(c) : last
  512. }
  513.  
  514. last
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement