Tenement Funster
12th January 2005, 22:22
Hello,
I have a lot of VHS video to encode to DVD and I've bought a Bt878 capture card, figured out AviSynth, etc. and am chugging along pretty well with what I have. However, the filter chain that I've worked out:
# Get the source material
video = AVISource("D:\Video\Duke-Maryland 2001 Final Four\huffyuv capture 1 part 3 cuts.avi").ConvertToYV12(interlaced=true)
# Seperate out the interlaced fields
video = SeperateFields()
even = SelectEven(video)
odd = SelectOdd(video)
# Clean up video
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=0, bw=16, bh=16, bt=3, measure=true)
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=1, bw=16, bh=16, bt=3, measure=true)
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=2, bw=16, bh=16, bt=3, measure=true)
even = MSmooth(even, threshold=4, strength=3, mask=false)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=0, bw=16, bh=16, bt=3, measure=true)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=1, bw=16, bh=16, bt=3, measure=true)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=2, bw=16, bh=16, bt=3, measure=true)
odd = MSmooth(odd, threshold=4, strength=3, mask=false)
# Re-interlace the fields
clean_video = Interleave(even, odd)
clean_video = Weave(clean_video)
# Run a decomb filter to seperate the composite signal
clean_video = GuavaComb(ConvertToYUY2(clean_video, interlaced=true), Mode="NTSC", Recall=85, MaxVariation=40, Activation=70)
return clean_video
Obviously takes a very long time to run on a single machine, even my Athlon XP overclocked to roughly 3400+ territory. Since I've done a lot of testing with different filter settings and filters, I'm pretty happy with the filterset and options I'm using right now and would prefer not to change them. However, I have a couple of spare machines lying around here not doing anything, and I thought of doing distributed filtering. It seems like a pretty natural task for parallelizing, as HuffYUV stores full individual frames and the work can be divided up along arbitrary frame borders.
What I'm looking to do is use (or write, if necessary) a program that will be aware of the various machines in the cluster, automatically partition out the video segments for each machine and run them through an AviSynth filter chain. Linux seems like a better idea for this to me because its design philosophy is much more accomodating of chaining together specialized, seperate tools for doing various tasks, especially on the command line. However, I am unaware of a version of AviSynth that works with Linux. Transcode (http://zebra.fh-weingarten.de/~transcode/) looks like a great tool and seems to have cluster-aware features, but unfortunately it would require that I port the AviSynth plugins I'm using to its architecture. I'm going to be keeping this in HuffYUV the whole time for the sake of simplicity, as MPEG2 encodes are not nearly as lengthy a process and distributed MPEG2 encoding would be an awful headache in my estimation if it's even possible.
Is there possibly a tool for Windows that would do what I'm looking for? I know it's possible to manually do everything via Trim() commands in AviSynth and setting up VirtualDub or another AviSynth-aware tool on each cluster node, and this would work out alright with me if there was a tool for automatically partitioning the video and writing the appropriate AviSynth scripts (IIRC, VirtualDub can be called from the command line to do various tasks, so SSH and some scripts would be able to take care of remote execution). A command line tool with processor-priority controls for pulling the frames from AviSynth and recompressing to HuffYUV would be even better than VirtualDub for this, as it could run in the background without bothering anyone else using the machine at the time.
If there's no Windows tool for this, does anyone know of something on Linux? I'm just putting this out there to see what sort of experience anyone else had had with distributed video filtering.
EDIT: Updated the script to reflect proper handling of interlaced video.
I have a lot of VHS video to encode to DVD and I've bought a Bt878 capture card, figured out AviSynth, etc. and am chugging along pretty well with what I have. However, the filter chain that I've worked out:
# Get the source material
video = AVISource("D:\Video\Duke-Maryland 2001 Final Four\huffyuv capture 1 part 3 cuts.avi").ConvertToYV12(interlaced=true)
# Seperate out the interlaced fields
video = SeperateFields()
even = SelectEven(video)
odd = SelectOdd(video)
# Clean up video
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=0, bw=16, bh=16, bt=3, measure=true)
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=1, bw=16, bh=16, bt=3, measure=true)
even = FFT3DFilter(even, sigma=6.0, beta=1.0, plane=2, bw=16, bh=16, bt=3, measure=true)
even = MSmooth(even, threshold=4, strength=3, mask=false)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=0, bw=16, bh=16, bt=3, measure=true)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=1, bw=16, bh=16, bt=3, measure=true)
odd = FFT3DFilter(odd, sigma=6.0, beta=1.0, plane=2, bw=16, bh=16, bt=3, measure=true)
odd = MSmooth(odd, threshold=4, strength=3, mask=false)
# Re-interlace the fields
clean_video = Interleave(even, odd)
clean_video = Weave(clean_video)
# Run a decomb filter to seperate the composite signal
clean_video = GuavaComb(ConvertToYUY2(clean_video, interlaced=true), Mode="NTSC", Recall=85, MaxVariation=40, Activation=70)
return clean_video
Obviously takes a very long time to run on a single machine, even my Athlon XP overclocked to roughly 3400+ territory. Since I've done a lot of testing with different filter settings and filters, I'm pretty happy with the filterset and options I'm using right now and would prefer not to change them. However, I have a couple of spare machines lying around here not doing anything, and I thought of doing distributed filtering. It seems like a pretty natural task for parallelizing, as HuffYUV stores full individual frames and the work can be divided up along arbitrary frame borders.
What I'm looking to do is use (or write, if necessary) a program that will be aware of the various machines in the cluster, automatically partition out the video segments for each machine and run them through an AviSynth filter chain. Linux seems like a better idea for this to me because its design philosophy is much more accomodating of chaining together specialized, seperate tools for doing various tasks, especially on the command line. However, I am unaware of a version of AviSynth that works with Linux. Transcode (http://zebra.fh-weingarten.de/~transcode/) looks like a great tool and seems to have cluster-aware features, but unfortunately it would require that I port the AviSynth plugins I'm using to its architecture. I'm going to be keeping this in HuffYUV the whole time for the sake of simplicity, as MPEG2 encodes are not nearly as lengthy a process and distributed MPEG2 encoding would be an awful headache in my estimation if it's even possible.
Is there possibly a tool for Windows that would do what I'm looking for? I know it's possible to manually do everything via Trim() commands in AviSynth and setting up VirtualDub or another AviSynth-aware tool on each cluster node, and this would work out alright with me if there was a tool for automatically partitioning the video and writing the appropriate AviSynth scripts (IIRC, VirtualDub can be called from the command line to do various tasks, so SSH and some scripts would be able to take care of remote execution). A command line tool with processor-priority controls for pulling the frames from AviSynth and recompressing to HuffYUV would be even better than VirtualDub for this, as it could run in the background without bothering anyone else using the machine at the time.
If there's no Windows tool for this, does anyone know of something on Linux? I'm just putting this out there to see what sort of experience anyone else had had with distributed video filtering.
EDIT: Updated the script to reflect proper handling of interlaced video.