shader
29th July 2016, 17:29
In order to develop scripts faster, I just take small parts of the video first. My idea is to use a switch, which is overwritten when running the final batch file via command arguments (see simplified script below).
import os, sys
import vapoursynth as vs
LongVideo = False
if len(sys.argv):
for arg in sys.argv:
if arg == "long=True":
LongVideo = True
print("\nLongVideo... {}".format("yes" if LongVideo else "no"), flush=True, file=sys.stderr)
core = vs.get_core()
if LongVideo == True:
video = core.std.BlankClip(length=100)
else:
video = core.std.BlankClip(length=1)
video.set_output()
enable_v210 = True
vspipe --arg full=True --y4m vs_test_args.py - | x264 --demuxer y4m - --output ..\arg_test.mp4
Unfortunatelly the usually known sys.argv do not work (if len(sys.argv): --> AttributeError: module 'sys' has no attribute 'argv').
Does anybody know the solution?
Thanks!
import os, sys
import vapoursynth as vs
LongVideo = False
if len(sys.argv):
for arg in sys.argv:
if arg == "long=True":
LongVideo = True
print("\nLongVideo... {}".format("yes" if LongVideo else "no"), flush=True, file=sys.stderr)
core = vs.get_core()
if LongVideo == True:
video = core.std.BlankClip(length=100)
else:
video = core.std.BlankClip(length=1)
video.set_output()
enable_v210 = True
vspipe --arg full=True --y4m vs_test_args.py - | x264 --demuxer y4m - --output ..\arg_test.mp4
Unfortunatelly the usually known sys.argv do not work (if len(sys.argv): --> AttributeError: module 'sys' has no attribute 'argv').
Does anybody know the solution?
Thanks!