1 (edited by Trung0246 05-10-2021 06:57:01)

Topic: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

Hi, I'm trying to make AviSynth/Vapoursynth to accept video pipe input, something like:

ffmpeg -i - <stuff> -f mpegts - | VSPipe.exe "script.py" - | vlc -

Then using SVPFlow plugin to process the live stream then pipe output to program (such as ffmpeg, vlc or even ffplay).

Since youtube-dl did not support some sources streamlink have and streamlink did not even work with SVP (SVP Index shows N/A) so I have to make SVP to accept video pipe output from streamlink:

cmd /c 'streamlink https://twitch.tv/xqcow best -o - | vlc -'

Since I don't really want to launch VLC and instead using SVP directly but I'm not sure if SVP have command-line version or AviSynth/Vapoursynth accept video pipe input at all. Most of the example (especially examples come from doom9.org) are using AviSynth/Vapoursynth for local video files (which is not what I wanted).

Any idea so far?

Re: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

not quite understood what you want to achieve in the end but if you don't want to launch vlc maybe you want to launch mpv instead?
if not then write your own .py script and process via vspipe...

3 (edited by Trung0246 05-10-2021 09:08:33)

Re: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

>if not then write your own .py script and process via vspipe...

Most of the example .py I saw involve opening local files and not reading from a input pipe. What I wanted to achieve is use streamlink to download the stream them pipe the output of streamlink into ffmpeg for transcoding. Then I want to pipe output from ffmpeg to VSPipe (this is the step I don't know how to achieve it), and then pipe output from VSPipe back to ffmpeg (then maybe I'll pipe the final ffmpeg output to vlc or just save it locally).

Another problem is ffms2 did not support reading from pipe input (see this github issue). As you can see I tried to make ffms2 open udp stream but that did not work either.

Unless there's another plugin that allows me to read input pipe then I don't know what is that plugin.

Or maybe there's a way to convert python sys.stdin pipe input to a format that make VSPipe understand it (this could be a potential alternative way to solve this issue but not sure yet).

Re: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

mpv can do encoding. Basically mpv IS "any-input" + "vapoursynth filter" + "ffmpeg encoder" all-in-one. This is what SVPcode does (and with live streams too).

5 (edited by Trung0246 05-10-2021 20:37:18)

Re: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

Interesting... so mvp can ingest pipe input from ffmpeg. As mvp ingest input SVP will then process the live stream. Then finally we can make mvp output that processed video to pipe?

Did not think about this since I'm assumed that mvp cannot output anything either.

So should I use separate mvp version (assuming SVP will hook into it automatically) or the mvp version that are included in mpv64 folder?

Re: Using SVPFlow + AviSynth/Vapoursynth for accepting stdin pipe input?

why not using mpv from SVP bundle?
It is good solution to know it is tested with SVP and works with VS filters