Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do_encode(line, cell=None, local_ns=None, stderr=sys.stderr, stdout=sys.stdout, decode_stdout=True, decode_stderr=True, y4m=True):
if cell is not None:
cmd = line
expr = cell
else:
try:
expr, cmd = line.split(" ", 1)
except ValueError:
return "No command given"
clip = retrieve_clip(expr, local_ns)
if not isinstance(clip, vapoursynth.VideoNode):
try:
clip = vapoursynth.get_output(clip)
except KeyError:
return "The expression must compute to a VideoNode not '%r'." % clip
return run_encoder(clip, cmd, stderr=stderr, stdout=stdout, decode_stdout=decode_stdout, decode_stderr=decode_stderr, y4m=y4m)
def format_core(core):
try:
return format_video(vs.get_output(0))
except KeyError:
return b""
def format_core(core):
try:
return video_converter(vs.get_output(0))
except KeyError:
return b""
def vpy_source_filter(path):
import runpy
runpy.run_path(path, {}, "__vapoursynth__")
return vapoursynth.get_output(0)
def __getitem__(self, item):
import vapoursynth
with find_environment():
item = vapoursynth.get_output(item)
if id(item) != self.current_output_ids[item]:
return None
return item