View Full Version : AviSynth pipe to Linux ffmpeg?


andoru
9th June 2018, 00:52
I'm trying to my avs expose scripts to ffmpeg so I could encode them to vp9 video on linux.
I've tried using avs2pipemod, but ffmpeg can't seem to detect/understand the video data being piped so either it's not supposed to work through Wine and pipe video data to ffmpeg, or I'm doing something wrong.
I've also seen that avs2yuv can be used for this, but I wanted to be able to encode RGB video.
Does anyone know of any alternatives? Or perhaps a way to encode my avs scripts to VP9 video under Wine?

Selur
9th June 2018, 06:37
Never tried avs2pipemod, but I can confirm that avs2yuv works fine (with YV12, YV16, YV24).
or I'm doing something wrong.
Since you don't show the command lines you use, how should anyone know?

Also you did read this from the help of avs2pipemod?
note1 : in yuv4mpeg2 output mode, RGB input that has 720pix height or more
will be converted to YUV with Rec.709 coefficients instead of Rec.601.

If you use something with a height > 720pixel and expect the input to be RGB this might cause problems,..

Or perhaps a way to encode my avs scripts to VP9 video under Wine?
use a 32bit ffmpeg version compiled for Windows. (64bit if you use 64bit Avisynth)

Cu Selur

Ps.: may be switch to Vapoursynth and drop wine,..

andoru
9th June 2018, 11:27
Since you don't show the command lines you use, how should anyone know?

Fair point, here you go:

$ wine ~/.wine/drive_c/avs2pipemod.exe -rawvideo ./test.avs | ffmpeg -i pipe: -c:v libvpx-vp9 -lossless 1 output.webm


[...]

avs2pipemod[info]: writing 3438 frames of 1920x1080 BGR-packed-8bit rawvideo.
pipe:: Invalid data found when processing input
avs2pipemod[info]: finished, wrote 0 frames [0%].
avs2pipemod[info]: total elapsed time is 0.160 sec.
avs2pipemod[error]: only wrote 0 of 3438 frames.



Also you did read this from the help of avs2pipemod?


If you use something with a height > 720pixel and expect the input to be RGB this might cause problems,..

I did read that, but I thought since I've set avs2pipemod to output raw video, I wouldn't have limitations. Besides, I want the input as well as the output to be RGB, that's one of the reasons why I chose to use VP9.


use a 32bit ffmpeg version compiled for Windows. (64bit if you use 64bit Avisynth)


I think I'll go down this path, thanks.

Selur
9th June 2018, 14:06
-rawvideo ./test.avs | ffmpeg -i pipe:
There is your problem. You are feeding raw video which has no headers and ffmpeg thus doesn't know how to process what you feed it with,...
If you feed ffmpeg with raw video you need set resolution, format, etc. before the input otherwise how should ffmpeg know what that data is that you feed to it.
something similar to:
.. | ffmpeg -pix_fmt yuv422p -s 640x352 -f rawvideo -i - ...
should be used,...