Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
7th January 2017, 17:48 | #1 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Filter once, output x times
There is a avisynth plugin called TwriteAvi, which can save the current output from line x in a script.
If it is put at the end one can encode for example a lossless file and a x264 video in parallel. The advantage here is, that the filters are processed only once for each output. It's very usefull for very slow scripts. Is something similar possible with vapoursynth? Maybe with some python magic?
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 7th January 2017 at 17:50. |
7th January 2017, 18:01 | #2 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
couldn't you use vspipe to ffmpeg ? ffmpeg can export multiple outputs . So one output branch might use ffmpeg libx264 , another might use ut video, a third might be resized libx264 version etc....
https://trac.ffmpeg.org/wiki/Creatin...iple%20outputs |
7th January 2017, 18:18 | #3 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
That's nice, but I use a modded x264. So a more generic approach would be better.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
7th January 2017, 19:41 | #5 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Exactly what do you need to output to? That's the real question.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
7th January 2017, 21:05 | #6 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
It depends, usually I use lagarith or utvideo for 8bit and x264 -q 0 for 10bit lossless encodes. After that lossy x264 or x265.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
9th January 2017, 02:28 | #7 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
I don't care what your opinions on functional programming languages are, VS and Avisynth filter chains are both by their natures effectively almost purely functional environments. For a pleasant experience, go with the flow, do as the Romans do and please resist digging into StainlessS' infinite toolbox of bad ideas. That means, stop considering "make frame requests have side effects" a reasonable solution to a problem - any problem at all.
Now, the problem you're trying to solve is absolutely trivial in nature - you just want to duplicate your output to feed two different consumers. This was obnoxious in Avisynth in 2005 (or whenever TWriteAvi originates) because the only possible way to produce output was through the arcane mechanics of VfW (or by using the API directly), but even then it was not at all unsolvable. Today we thankfully use a far simpler and more portable I/O mechanism - pipes - which comes with a huge ecosystem of tools, so let me introduce you to tee, which does exactly what you want. If you're on Unix you can feed both processes directly (see the examples provided here) but on Windows I think you might have to set up a named pipe. Not sure though, I'm not a PowerShell expert, so I leave figuring that out as an exercise to the reader. e: if you want the output somewhere in the middle of the filter chain, you can output, tee off an encoder, and pipe the other stream back into a new VS environment. Won't be particularly efficient for several reasons but it'll get you there without having to write the I/O and keeping track of which frames have been requested and in what order in Python. Last edited by TheFluff; 9th January 2017 at 03:25. |
9th January 2017, 02:51 | #8 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
You pontificate way too much.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
|