此代码工作正常:
SQL> var v_rc_emps refcursor
SQL> var v_rc_jobs refcursor
SQL> exec get_result(20, 'CLERK', :v_rc_emps, :v_rc_jobs);
PL/SQL procedure successfully completed.
SQL> print v_rc_emps
ENAME
----------
SMITH
JONES
SCOTT
ADAMS
FORD
SQL> print v_rc_jobs
ENAME
----------
SMITH
JAMES
MILLER
SQL>
但是在执行以下代码后:
cmd = "ffmpeg -y -loop 1 -i " + url1 + " -ss 0 -t 5 " + " -
filter_complex" + "
[0:v]scale=w=-2:h=3*720,crop=w=3*1080/1.2:h=3*720/1.2:y=t*in_h/5-
t*out_h/5,scale=w=1080:h=720 " + " -c:v h264 -crf 18 -preset veryfast
" + url2
os.system(cmd)
我收到一个错误:
cmd = "ffmpeg -y -loop 1 -i " + url1 + " -ss 0 -t 5 " + " -
filter_complex" + "
[0:v]scale=w=-2:h=3*720,crop=w=3*1080/1.2:h=3*720/1.2:y=(in_h-out_h)-
t*(in_h-out_h)/5,scale=w=1080:h=720 " + " -c:v h264 -crf 18 -preset
veryfast " + url2
os.system(cmd)
所以括号有问题。有什么办法可以解决吗?
答案 0 :(得分:1)
括号对shell有特殊的意义。您可以使用反斜杠(您必须加倍:\\(in_h-out_h\\)
)来保护它们,或者您可以将整个序列放在单引号中:
... + "'[0:v]scale=w=-2:h=3720,crop=w=31080/1.2:h=3720/1.2:y=(in_h-out_h)-t(in_h-out_h)/5,scale=w=1080:h=720'" + ...