About Vapour Synth

Required

https://github.com/vapoursynth/vapoursynth
https://github.com/HomeOfVapourSynthEvolution/VapourSynth-Waifu2x-caffe
https://github.com/HomeOfVapourSynthEvolution/mvsfunc

For Python:
pip install vapoursynth

The searched paths are:

<AppData>\VapourSynth\plugins32 or <AppData>\VapourSynth\plugins64
<VapourSynth path>\core32\plugins or <VapourSynth path>\core64\plugins
<VapourSynth path>\plugins32 or <VapourSynth path>\plugins64

Usage

For x264:
vspipe --y4m script.vpy - | x264 --demuxer y4m - --output encoded.mkv
For FFmpeg:
vspipe --y4m script.vpy - | ffmpeg -i pipe: enc

2x

import vapoursynth as vs
import mvsfunc as mvf

sourceFile = r"*.mp4"
core = vs.get_core(threads = 12)
core.max_cache_size = 8000
src = core.ffms2.Source(source = sourceFile)
src = mvf.Depth(src, depth = 32)
block_w = src.width / 10
block_h = src.height / 10
src = core.caffe.Waifu2x(
	clip = src,
	noise = 3,
	scale = 2,
	block_w = block_w,
	block_h = block_h,
	model = 6,
	cudnn = True,
	tta = False,
	batch = 1)
src = mvf.ToYUV(src, full = False, depth = 8, css = "420", matrix = 1)
src.set_output()

## use ffmpeg + waifu2x-cafffe:
##     ffmpeg -i input.mkv -f image2 output%10d.png
##     ffmpeg -framerate 23.976 -i inputf%10d.png -c:v libx264 -crf 23.976 output.mp4

 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注