Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在grailsweb应用程序中运行exec_Linux_Tomcat_Grails_Groovy_Ffmpeg - Fatal编程技术网

Linux 在grailsweb应用程序中运行exec

Linux 在grailsweb应用程序中运行exec,linux,tomcat,grails,groovy,ffmpeg,Linux,Tomcat,Grails,Groovy,Ffmpeg,我试图在grails服务器(tomcat6)上调用exec(),以便根据用户的需要运行ffmpeg转换。我的尝试如下: def command = """ffmpeg -r 5 -i ./grails-app/assets/images/frame/%03d.jpeg -vcodec libvpx -r 5 out.webm""" def proc = command.execute() proc.waitFor() def res = [] res << "return code:

我试图在grails服务器(tomcat6)上调用exec(),以便根据用户的需要运行ffmpeg转换。我的尝试如下:

def command = """ffmpeg -r 5 -i ./grails-app/assets/images/frame/%03d.jpeg -vcodec libvpx -r 5 out.webm"""
def proc = command.execute()
proc.waitFor()
def res = []
res << "return code: ${proc.exitValue()}"
res << "stderr: ${proc.err.text}"
res << "stdout: ${proc.in.text}"
return res
def command=“”ffmpeg-r5-i./grails app/assets/images/frame/%03d.jpeg-vcodec libvpx-r5 out.webm”“”
def proc=command.execute()
waitFor()程序
def res=[]

res您可能应该使路径可配置。如果“assets”是assets pipeline插件文件夹,则它将位于生产中的不同位置。创建一个war并查看内部。或者尝试使用类似以下内容的
assetPath(src:“images/frame/%03d.jpeg”)
也可能Grails不喜欢文件名中的
%03d
,它看起来像字符串格式化程序。请尝试重命名文件。我通过使用%d而不是%03d(我的文件名为1.jpg、2.jpg而不是001.jpg等)解决了此问题。谢谢大家的帮助。