I am trying to convert the following piece of code:
from vapoursynth import core
import sys
video = core.ffms2.Source(source='test.mkv')
video = core.std.Transpose(video)
video.output(sys.stdout, True)
The following code (passing Julia's stdout):
using PyCall
#ENV["PYTHON"] = "/usr/bin/python"
@pyimport vapoursynth as vs
@pyimport sys
core = vs.get_core()
video = core[:ffms2][:Source](source="test.mkv")
video = core[:std][:Transpose](video)
video[:output](stdout, true)
gives me a segfault.
Passing python's stdout:
using PyCall
@pyimport vapoursynth as vs
@pyimport sys
core = vs.get_core()
video = core[:ffms2][:Source](source="test.mkv")
video = core[:std][:Transpose](video)
video[:output](sys.stdout, true)
Fails when I run:
$ julia ex03.jl | x264 --demuxer y4m -o out.mkv -
y4m [info]: 768x1280p 0:0 @ 30/1 fps (cfr)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 3.2
y4m [error]: bad frame header length
y4m [error]: bad frame header length
x264 [info]: frame I:1 Avg QP:28.50 size: 53237
x264 [info]: mb I I16..4: 42.0% 29.0% 29.0%
x264 [info]: 8x8 transform intra:29.0%
x264 [info]: coded y,uvDC,uvAC intra: 38.0% 53.4% 29.0%
x264 [info]: i16 v,h,dc,p: 37% 29% 3% 31%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 19% 15% 6% 5% 6% 4% 5% 3%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 25% 13% 3% 3% 4% 4% 4% 4%
x264 [info]: i8c dc,h,v,p: 48% 26% 24% 2%
x264 [info]: kb/s:12776.88
encoded 1 frames, 21.80 fps, 12950.16 kb/s
ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'vapoursynth.Error'>
'File write call returned an error'
File "src/cython/vapoursynth.pyx", line 1338, in vapoursynth.VideoNode.output
Stacktrace:
[1] pyerr_check at /home/jose/.julia/packages/PyCall/rUul9/src/exception.jl:60 [inlined]
[2] pyerr_check at /home/jose/.julia/packages/PyCall/rUul9/src/exception.jl:64 [inlined]
[3] macro expansion at /home/jose/.julia/packages/PyCall/rUul9/src/exception.jl:84 [inlined]
[4] __pycall!(::PyObject, ::Ptr{PyCall.PyObject_struct}, ::PyObject, ::Ptr{Nothing}) at /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:44
[5] _pycall!(::PyObject, ::PyObject, ::Tuple{PyObject,Bool}, ::Int64, ::Ptr{Nothing}) at /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:22
[6] _pycall!(::PyObject, ::PyObject, ::Tuple{PyObject,Bool}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:11
[7] #call#89(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::PyObject, ::PyObject, ::Vararg{Any,N} where N) at /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:89
[8] (::PyObject)(::PyObject, ::Vararg{Any,N} where N) at /home/jose/.julia/packages/PyCall/rUul9/src/pyfncall.jl:89
[9] top-level scope at none:0
in expression starting at /home/jose/src/julia/vapoursynth/python_based/ex03.jl:8
I am trying to convert the following piece of code:
The following code (passing Julia's stdout):
gives me a segfault.
Passing python's stdout:
Fails when I run:
But if I do:
I am able to play the video.
Any clue about what is going on?