微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

将ffmpegpipe道redirect到subprocess

我怎样才能redirect从一个进程的ffmpegpipe道到subprocess标准input?

我想实现与cmd中的pipe道相同的function:

ffmpeg -i test.mov pipe:1 | vlc -

我试过了:

avio_open("pipe:1"); // ffmpeg open pipe to STD_OUTPUT_HANDLE. // lots of code STARTUPINFO si; PROCESS_@R_63_4045@ION pi; Security_ATTRIBUTES saAttr = {0}; saAttr.nLength = sizeof(Security_ATTRIBUTES); saAttr.bInheritHandle = TRUE; saAttr.lpSecurityDescriptor = NULL; CreatePipe(&hReadPipe,&hWritePipe,&saAttr,0); SetStdHandle(STD_OUTPUT_HANDLE,hWritePipe); ZeroMemory(&si,sizeof(si)); ZeroMemory(&pi,sizeof(pi)); si.cb = sizeof(si); si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = hReadPipe; CreateProcess(NULL,// No module name (use command line) L"C:\Program Files (x86)\VideoLAN\VLC\vlc -vv --demux ffmpeg -",// Command line NULL,// Process handle not inheritable NULL,// Thread handle not inheritable TRUE,// Set handle inheritance to FALSE 0,// No creation flags NULL,// Use parent's environment block NULL,// Use parent's starting directory &si,// Pointer to STARTUPINFO structure &pi ) // Pointer to PROCESS_@R_63_4045@ION structure // start ffmpeg write to file.

但我真的不知道我在做什么。

hidapi:发送小于caps.OutputReportByteLength的数据包

没有身体的function

需要关于图像编辑库的build议

getcpuTime只返回两个值(0或15625000000) – 这是正确的吗?

相互排斥(在静态库中)

有没有任何GetStdHandle通常不会打印到控制台?

BSD或麻省理工学院许可的Windows DLL汇编器和链接

在另一个程序/脚本中实时使用Sysinternals Process Monitor的输出

在win32(windows.h)中有一个便利的function,将lParam转换为POINT?

closures应用程序和结束从任务pipe理器的过程有什么区别?

Python在我的脚本中未能导入nltk,但在解释器中工作

你可以尝试创建一个管道:

调用CreatePipe()来创建一个读取句柄和一个写入句柄

调用SetStdHandle()使管道的写入句柄成为新的stdout

指定管道的读取句柄为hStdInput到CreateProcess()

更新:

如果您的应用程序使用printf()打印到STD输出控制台,则可能需要破解stdout结构并替换那里的句柄。 在任何情况下,尝试进入一个printf()调用,这个调用没有正确的重定向,最后看看它使用了哪个句柄。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐