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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th January 2017, 17:48   #1  |  Link
ChaosKing
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.
ChaosKing is offline   Reply With Quote
Old 7th January 2017, 18:01   #2  |  Link
poisondeathray
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
poisondeathray is offline   Reply With Quote
Old 7th January 2017, 18:18   #3  |  Link
ChaosKing
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
ChaosKing is offline   Reply With Quote
Old 7th January 2017, 19:37   #4  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
get_read_array and "file" related functions in Python
Everything you need
feisty2 is offline   Reply With Quote
Old 7th January 2017, 19:41   #5  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
Quote:
Originally Posted by ChaosKing View Post
That's nice, but I use a modded x264. So a more generic approach would be better.
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
Myrsloik is online now   Reply With Quote
Old 7th January 2017, 21:05   #6  |  Link
ChaosKing
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
ChaosKing is offline   Reply With Quote
Old 9th January 2017, 02:28   #7  |  Link
TheFluff
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.
TheFluff is offline   Reply With Quote
Old 9th January 2017, 02:51   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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 ???
StainlessS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.