5
0

First commit

This commit is contained in:
fire bingo 2019-07-09 17:52:27 -07:00
commit b01c0cada7
4 changed files with 99 additions and 0 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
*.mkv
*.mp4
*.wav
*.flac
*.ffindex
*.png

21
01/audiocut.py Normal file
View File

@ -0,0 +1,21 @@
import vapoursynth as vs
import audiocutter
core = vs.core
ts = "cap/Senki Zesshou Symphogear XV - 01 (MX).d2v"
src = core.d2v.Source(ts)
src = src.vivtc.VFM(1).vivtc.VDecimate()
ac = audiocutter.AudioCutter()
audio = ac.split(src, [(812, 11288, "Intro"), (12966, 23349, "Part A"),
(24788, 34763, "Part B"), (34764, 37158, "ED"),
(37159, 37974, "Part C")])
ac.ready_qp_and_chapters(audio)
audio.set_output(0)
if __name__ == "__main__":
ac.cut_audio("mx_audio.m4a", audio_source="audio.aac")

22
01/x264.vpy Normal file
View File

@ -0,0 +1,22 @@
import vapoursynth as vs
import kagefunc as kgf
import fvsfunc as fvf
from nnedi3_rpow2 import nnedi3_rpow2
core = vs.core
core.max_cache_size = 8192
src = core.ffms2.Source("[HorribleSubs] Symphogear XV - 01 [1080p].mkv")
src = fvf.Depth(src, 16)
scaled = kgf.inverse_scale(src, height=872, kernel="lanczos", taps=5, mask_detail=True)
scaled = nnedi3_rpow2(scaled).resize.Spline36(1920, 1080, format=vs.YUV420P16)
scaled = kgf.hybriddenoise(scaled, knl=0.5, sigma=1, radius1=0)
db = scaled.f3kdb.Deband(range=12, y=60, cb=40, cr=40, grainy=15, grainc=0, output_depth=16)
mask = kgf.retinex_edgemask(scaled).std.Binarize(5000)
final = core.std.MaskedMerge(db, scaled, mask)
final = fvf.Depth(final, 10)
final = kgf.adaptive_grain(final)
final.set_output()
#ffmpeg
#vspipe -y "x264.vpy" - | ffmpeg -i pipe: -c:v libx264 -tune animation -crf 16 -pix_fmt yuv420p10 -preset slow -y "test1.mp4"

50
01/x265_Icebingo.vpy Normal file
View File

@ -0,0 +1,50 @@
import vapoursynth as vs
import fag3kdb
import kagefunc as kgf
import fvsfunc as fvf
import vsTAAmbk as taa
core = vs.get_core()
core.max_cache_size = 16384
src = core.ffms2.Source("[HorribleSubs] Symphogear XV - 01 [1080p].mkv",track=0)
#resmapling to 444 and 16bit for filters
resam = src.std.AssumeFPS(fpsnum=24000, fpsden=1001)
resam = core.fmtc.bitdepth(resam, bits=16)
resam = core.fmtc.resample(resam, css="444", kernel="lanczos")
#gpu accelerated noise reduction
#i use a h paramater quite a bit under the default 1.2 to prevent killing more details but mostly for personal taste
fil = core.knlm.KNLMeansCL(resam, d=1, a=2, h=0.4, channels="YUV", device_type='gpu', device_id=0)
#episode doesnt really have any aliasing but it doesnt hurt and doesnt eat cpu time at all relatively
taa = taa.TAAmbk(fil,aatype='Nnedi3')
#flash3kyuu_deband
#retinex_edgemask merge is used to help preserve details on edges
band = taa.f3kdb.Deband(range=12, y=60, cb=40, cr=40, grainy=15, grainc=0, output_depth=16)
mask = kgf.retinex_edgemask(fil)
merge = core.std.MaskedMerge(band, fil, mask)
#adaptive grain helps preserve details from the encoder. this is less important for x265 but it doesnt hurt to do
merge = kgf.adaptive_grain(merge)
#debugging edgemask merge
#stack1 = core.std.StackHorizontal([resam, fil])
#blank = core.std.BlankClip(merge)
#stack2 = core.std.StackHorizontal([core.std.ShufflePlanes(clips=[mask,blank], planes=[0, 1, 2], colorfamily=vs.YUV), merge])
#merge = core.std.StackVertical([stack1, stack2])
#debugging taa
#stack1 = core.std.StackHorizontal([fil, taa])
#stack2 = core.std.StackHorizontal([core.std.BlankClip(taa), core.std.MakeDiff(fil, taa, planes=[0])])
#merge = core.std.StackVertical([stack1, stack2])
#actual final output
final = core.fmtc.resample(merge, css="420", kernel="lanczos")
final = core.fmtc.bitdepth(final, bits=10, dmode=3)
final.set_output()
#ffmpeg
#vspipe -y "x265_Icebingo.vpy" - | ffmpeg -i pipe: -c:v libx264 -tune animation -crf 16 -pix_fmt yuv420p10 -preset slow -y "test1.mp4"
#vspipe -y "x265_Icebingo.vpy" - | ffmpeg -i pipe: -c:v libx265 -tune animation -crf 17 -pix_fmt yuv420p10 -preset slow -y "xv01.mp4"