poisondeathray
25th January 2022, 01:24
As demonstrated in the vsrawsource thread, raws.Source accepts "-" stdin raw pipe input
e.g. something like this
ffmpeg -f lavfi -i testsrc2=rate=24000/1001:duration=10:s=640x480 -f rawvideo - | vspipe --y4m script.vpy - | ffplay -f yuv4mpegpipe -i -
import vapoursynth as vs
core = vs.core
clip = core.raws.Source("-", width=640, height=480, src_fmt="YUV420P8", fpsnum=24000, fpsden=1001)
clip.set_output()
1) How to call ffmpeg within vpy script , perhaps as a subprocess ?
pseudo code crashes vsedit , I tried several combinations
import vapoursynth as vs
core = vs.core
import subprocess
#subprocess.call(['ffmpeg', '-f', 'lavfi', '-i', 'testsrc2=rate=24000/1001:duration=10:s=640x480', '-f', 'rawvideo', '-', '|'])
process = subprocess.Popen(['ffmpeg', '-f', 'lavfi', '-i', 'testsrc2=rate=24000/1001:duration=10:s=640x480', '-f', 'rawvideo', '-', '|'])
clip = core.raws.Source("-", width=640, height=480, src_fmt="YUV420P8", fpsnum=24000, fpsden=1001)
#clip.set_output()
clip.set_output(process.stdin)
process.communicate()
2) Is there another pipe input filter that accepts yuv4mpegpipe instead of rawvideo ?
e.g. something like this
ffmpeg -f lavfi -i testsrc2=rate=24000/1001:duration=10:s=640x480 -f rawvideo - | vspipe --y4m script.vpy - | ffplay -f yuv4mpegpipe -i -
import vapoursynth as vs
core = vs.core
clip = core.raws.Source("-", width=640, height=480, src_fmt="YUV420P8", fpsnum=24000, fpsden=1001)
clip.set_output()
1) How to call ffmpeg within vpy script , perhaps as a subprocess ?
pseudo code crashes vsedit , I tried several combinations
import vapoursynth as vs
core = vs.core
import subprocess
#subprocess.call(['ffmpeg', '-f', 'lavfi', '-i', 'testsrc2=rate=24000/1001:duration=10:s=640x480', '-f', 'rawvideo', '-', '|'])
process = subprocess.Popen(['ffmpeg', '-f', 'lavfi', '-i', 'testsrc2=rate=24000/1001:duration=10:s=640x480', '-f', 'rawvideo', '-', '|'])
clip = core.raws.Source("-", width=640, height=480, src_fmt="YUV420P8", fpsnum=24000, fpsden=1001)
#clip.set_output()
clip.set_output(process.stdin)
process.communicate()
2) Is there another pipe input filter that accepts yuv4mpegpipe instead of rawvideo ?