gpt4 book ai didi

java - Runtime.getRuntime.exec() 问题

转载 作者:行者123 更新时间:2023-12-01 19:17:44 26 4
gpt4 key购买 nike

嗨我正在尝试执行 Runtime.getRuntime.exec("ffmpeg -i inputfile image2 imagefile");

我的代码中的输入文件是视频文件,我通过 GUI 选择视频文件

我将它存储在一个变量中。那么我如何使用变量名来代替字符串?它确实如此

如果我替换变量,则不起作用。任何帮助都非常有用

最佳答案

String inputfileVariable = ...; << maybe you calculate, maybe get from some GUI component
Runtime.getRuntime.exec("ffmpeg -i " + inputfileVariable + " image2 imagefile");

这里没有魔法,它只是一个字符串。

关于java - Runtime.getRuntime.exec() 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5878640/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com