ffmpeg executed from Java#39;s processbuilder does not return under windows 7(从 Java 的 processbuilder 执行的 ffmpeg 在 windows 7 下不返回)
问题描述
我试图构建一个调用 ffmpeg 二进制文件的 ProcessBuilder.我的问题是调用它,它在 MacOs、Ubuntu 和 WindowsXp 下完美返回,但在 Windows7 下,waitFor() 永远不会返回.
I was trying to build up a ProcessBuilder calling the ffmpeg binary. My problem is that calling it, it returns perfectly under MacOs, Ubuntu and WindowsXp, but under Windows7 the waitFor() never returns.
有没有人在windows 7下有类似的经历?任何帮助将不胜感激!
Has anyone similar experience under windows 7? Any help would be appreciated!
我的命令:
ProcessBuilder pb = new ProcessBuilder( );
pb.command( "C:\Windows\System32\cmd.exe", "/c", "c:\ffmpeg\bin\ffmpeg.exe", "-version" );
也试过这些:
pb.command( "c:\ffmpeg\bin\ffmpeg.exe", "-version" );
pb.command( "C:\Windows\System32\cmd.exe", "/c", "start c:\ffmpeg\bin\ffmpeg.exe -version" );
结果是一样的.:(
推荐答案
看起来您的进程在其输出和/或错误流中写入了一些内容.他们的缓冲区溢出和进程阻塞.您应该读出并错误处理您的流程以避免这种情况.
Looks like your process writes something in its out and/or err streams. Their buffer overflow and process blocks. You should read out and err streams of your process to avoid this.
请参阅当 Runtime.exec() 获胜时"t"了解更多信息
这篇关于从 Java 的 processbuilder 执行的 ffmpeg 在 windows 7 下不返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 Java 的 processbuilder 执行的 ffmpeg 在 windows 7 下不返回


- 如何使用WebFilter实现授权头检查 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01