JasinChen
帖子: 43
注册时间: 2017-06-10 22:14

【已解决】vspipe 错误

源文件是个隔行视频
vs 版本 : R40 x64

代码: 全选

import sys
import vapoursynth as vs
import havsfunc as haf
import mvsfunc as mvf
import adjust
import vsTAAmbk as taa
import math
core = vs.get_core(accept_lowercase=True,threads=16)
core.max_cache_size = 2000
video = core.ffms2.source("00005.m2ts")
a = core.std.Trim(video, 0, 2399)
a = haf.QTGMC(a, Preset='very slow', TFF=True, FPSDivisor =2,opencl=True)
a = core.std.AssumeFPS(a, fpsnum=24000, fpsden=1001)
b = core.std.Trim(video, 2400, 38359)
b = core.vivtc.VFM(b, order=1)
b = core.std.SelectEvery(b, 5, [0,1,3,4])#manual IVTC
b = haf.daa(b,opencl=True)
b = core.warp.AWarpSharp2(b,thresh=128,blur=15,type=1)
b = haf.santiag(b,opencl=True)
b = haf.daa(b,opencl=True)
b = haf.DeHalo_alpha(b)
b = haf.HQDeringmod(b)
c = core.std.Trim(video, 38360, 40459)
c = haf.QTGMC(c, Preset='very slow', TFF=True, FPSDivisor =2,opencl=True)
c = core.std.AssumeFPS(c, fpsnum=24000, fpsden=1001)
d = core.std.Trim(video, 40460, 40939)
d = core.vivtc.VFM(d, order=1)
d = core.std.SelectEvery(d, 5, [0,1,3,4])
d = haf.daa(d,opencl=True)
d = core.warp.AWarpSharp2(d,thresh=128,blur=15,type=1)
d = haf.santiag(d,opencl=True)
d = haf.daa(d,opencl=True)
d = haf.DeHalo_alpha(d)
d = haf.HQDeringmod(d)
video = core.std.Splice([a,b,c,d])
video.set_output()
Vspipe.exe每次在视频拼接的地方发生错误并退出,且退出的地方是随机的,求解
上次由 JasinChen 在 2017-12-24 18:05,总共编辑 1 次。
头像
remixer
帖子: 15
注册时间: 2012-05-28 13:25

Re: vspipe 错误

m2ts 用 LWLibavSource 试试
JasinChen
帖子: 43
注册时间: 2017-06-10 22:14

Re: vspipe 错误

remixer 写了:m2ts 用 LWLibavSource 试试
试过了,一样。每次都是在合并视频的地方错误
头像
Holy
核心会员
核心会员
帖子: 235
注册时间: 2010-09-24 9:28

Re: vspipe 错误

樓主這寫法犯了多數人在一開始做 scene filter 時會犯的錯誤,來兩個範例腳本:

代码: 全选

import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

clip = core.std.BlankClip(width=1280, height=720, format=vs.YUV420P8, length=1000, color=[128, 128, 128])

A = core.std.Trim(clip, first=0, length=100)
A = haf.QTGMC(A, FPSDivisor=2, TFF=True, opencl=True)

B = core.std.Trim(clip, first=200, length=100)
B = haf.QTGMC(B, FPSDivisor=2, TFF=True, opencl=True)

C = core.std.Trim(clip, first=400, length=100)
C = haf.QTGMC(C, FPSDivisor=2, TFF=True, opencl=True)

D = core.std.Trim(clip, first=600, length=100)
D = haf.QTGMC(D, FPSDivisor=2, TFF=True, opencl=True)

E = core.std.Trim(clip, first=800, length=100)
E = haf.QTGMC(E, FPSDivisor=2, TFF=True, opencl=True)

clip = core.std.Splice([A, B, C, D, E])

clip.set_output()

代码: 全选

import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

clip = core.std.BlankClip(width=1280, height=720, format=vs.YUV420P8, length=1000, color=[128, 128, 128])

deint = haf.QTGMC(clip, FPSDivisor=2, TFF=True, opencl=True)

A = core.std.Trim(deint, first=0, length=100)
B = core.std.Trim(deint, first=200, length=100)
C = core.std.Trim(deint, first=400, length=100)
D = core.std.Trim(deint, first=600, length=100)
E = core.std.Trim(deint, first=800, length=100)

clip = core.std.Splice([A, B, C, D, E])

clip.set_output()
這兩個腳本達到的目的是一樣的,但第二個腳本避免了多個濾鏡 instantiation 的問題,你可以跑個 benchmark 然後觀察下這兩個腳本從開始到結束時在內存及顯存上的使用量變化。

回歸樓主這腳本來看,這 m2ts 應該是個 30i+24t 混合的源,a 跟 c 是對 30i 部份做 deinterlace,而 b 跟 d 是對 24t 部份做 IVTC。既然 a 跟 c (或 b 跟 d) 所用的濾鏡與參數都相同,那麼完全可以改成第二個範例腳本的寫法。另外樓主用了很多 opencl,最好留意下顯存使用量問題,目測樓主 crash 原因不是內存就是顯存爆掉。
图片
JasinChen
帖子: 43
注册时间: 2017-06-10 22:14

Re: vspipe 错误

Holy 写了:樓主這寫法犯了多數人在一開始做 scene filter 時會犯的錯誤,來兩個範例腳本:

代码: 全选

import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

clip = core.std.BlankClip(width=1280, height=720, format=vs.YUV420P8, length=1000, color=[128, 128, 128])

A = core.std.Trim(clip, first=0, length=100)
A = haf.QTGMC(A, FPSDivisor=2, TFF=True, opencl=True)

B = core.std.Trim(clip, first=200, length=100)
B = haf.QTGMC(B, FPSDivisor=2, TFF=True, opencl=True)

C = core.std.Trim(clip, first=400, length=100)
C = haf.QTGMC(C, FPSDivisor=2, TFF=True, opencl=True)

D = core.std.Trim(clip, first=600, length=100)
D = haf.QTGMC(D, FPSDivisor=2, TFF=True, opencl=True)

E = core.std.Trim(clip, first=800, length=100)
E = haf.QTGMC(E, FPSDivisor=2, TFF=True, opencl=True)

clip = core.std.Splice([A, B, C, D, E])

clip.set_output()

代码: 全选

import vapoursynth as vs
import havsfunc as haf
core = vs.get_core()

clip = core.std.BlankClip(width=1280, height=720, format=vs.YUV420P8, length=1000, color=[128, 128, 128])

deint = haf.QTGMC(clip, FPSDivisor=2, TFF=True, opencl=True)

A = core.std.Trim(deint, first=0, length=100)
B = core.std.Trim(deint, first=200, length=100)
C = core.std.Trim(deint, first=400, length=100)
D = core.std.Trim(deint, first=600, length=100)
E = core.std.Trim(deint, first=800, length=100)

clip = core.std.Splice([A, B, C, D, E])

clip.set_output()
這兩個腳本達到的目的是一樣的,但第二個腳本避免了多個濾鏡 instantiation 的問題,你可以跑個 benchmark 然後觀察下這兩個腳本從開始到結束時在內存及顯存上的使用量變化。

回歸樓主這腳本來看,這 m2ts 應該是個 30i+24t 混合的源,a 跟 c 是對 30i 部份做 deinterlace,而 b 跟 d 是對 24t 部份做 IVTC。既然 a 跟 c (或 b 跟 d) 所用的濾鏡與參數都相同,那麼完全可以改成第二個範例腳本的寫法。另外樓主用了很多 opencl,最好留意下顯存使用量問題,目測樓主 crash 原因不是內存就是顯存爆掉。
谢谢,问题已解决,目测是内存爆了。

回到 “VapourSynth”