将FFMPEG的输出重定向到Windows上的多个命名管道 [英] Redirect FFMPEG's output to multiple named pipes on Windows

查看:615
本文介绍了将FFMPEG的输出重定向到Windows上的多个命名管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将视频和音频数据流传输到Windows上的两个单独的命名管道中.

I am trying to stream video and audio data into two separate named pipes on Windows.

ffmpeg.exe -f dshow -i video="My camera name":audio="My microphone name" -map 0:1 -ac 1 -f f32le \\.\pipe\audioStream -map 0:0 -f mjpeg \\.\pipe\videoStream

问题是FFMPEG似乎不了解输出\\.\pipe\audioStream\\.\pipe\videoStream是管道,并将它们视为文件.

The problem is that FFMPEG does not seem to understand that the outputs \\.\pipe\audioStream and \\.\pipe\videoStream are pipes and treats them like files.

  1. 如果在FFMPEG启动时已经创建了管道,则它想覆盖它们并失败.
  2. 否则,它会抱怨该路径不存在并且失败.

据我了解,指定pipe:协议应该可以解决问题,但是即使使用单个管道,我也无法弄清楚如何正确使用它.我已经尝试过:

As far as I understand, specifying the pipe: protocol should do the trick, but I can't figure out how to use it properly, even with a single pipe. I have tried:

  1. pipe:pipeName
  2. pipe:pipe\pipeName
  3. pipe:\\.\pipe\pipeName
  4. pipe://pipeName
  5. pipe://pipe\pipeName
  6. pipe://\\.\pipe\pipeName
  1. pipe:pipeName
  2. pipe:pipe\pipeName
  3. pipe:\\.\pipe\pipeName
  4. pipe://pipeName
  5. pipe://pipe\pipeName
  6. pipe://\\.\pipe\pipeName

我总是得到相同的结果:输出被写入控制台而不是管道.如果在FFMPEG启动时管道已经存在,则没有任何内容连接到管道.

I always end up with the same result: the output is written to the console and not to the pipe. If the pipe already exists when the FFMPEG starts, nothing connects to the pipe.

是否可以在Windows上将FFMPEG与命名管道一起使用?如果是,执行此操作的正确方法是什么?

Is it possible to use FFMPEG with named pipes on Windows? If yes, what is the proper way to do this?

推荐答案

根据我的经验,使用FFmpeg传递到多个输出从未用过.建立管道涉及阻塞类型的数据传输.馈送器FFmpeg希望馈送的程序在发送其他卡盘之前先吃掉"一个数据卡盘.在有两个提要的情况下,FFmpeg不知道哪个提要的程序具有优先权,并且在有疑问时FFmpeg不执行任何操作,因此FFmpeg永远挂起,等待两个管道的另一端发生某些事情.

From my experience piping to multiple outputs with FFmpeg has never worked. Establishing a pipe involves data transfers of blocking type. The feeder FFmpeg expects the feeded program to "eat" a chuck of data before sending other chucks. In case of two feeds FFmpeg doesn't know which feeded programs has the priority and when in doubt FFmpeg does nothing, hence FFmpeg hangs forever waiting that something on the other side of the two pipes happens.

这篇关于将FFMPEG的输出重定向到Windows上的多个命名管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆