gpt4 book ai didi

node.js - 需要将 rtsp 视频输出定向到 stdout

转载 作者:太空宇宙 更新时间:2023-11-03 23:15:44 26 4
gpt4 key购买 nike

我需要让 gstreamer 从 rtsp uri 获取视频并将视频发送到 stdout,以便模拟来自 ffmpeg 的类似行为。

我可以在终端上执行此操作(并获取原始二进制数据),但在 Node 内部时,我得到:

"erroneous pipeline syntax error".

gst-launch-1.0 uridecodebin silent=true uri=rtsp://192.168.x.x:8800/test.stm ! fdsink fd=1 

当上述命令与“autovideosink”一起使用时,我可以观看视频。

我需要使用 stdout 的原因是因为现有应用程序使用 Fluent-ffmpeg 并且它使用“pipe:1”,这基本上是相同的事情。我希望尽可能减少对现有应用程序的干扰。

在 Node 应用程序内,我通过“spawn”命令调用 gst-lauch-1.0,如下所示:

var gstreamerProc = spawn(command, args, options);

地点:

 command: '/usr/bin/gst-launch-1.0'
args: ["uridecodebin","silent=true","uri=rtsp://192.168.x.x:8800/test.stm","!","queue","! fdsink fd=0"]
options: {"captureStdout":false,"niceness":0}"

从原始的 Fluent-ffmpeg/lib/processor.js 中,此注释描述了“选项”中找到的值

  /*
:
* The 'options' argument may contain the following keys:
* - 'niceness': specify process niceness, ignored on Windows (default: 0)
* - `cwd`: change working directory
* - 'captureStdout': capture stdout and pass it to 'endCB' as its 2nd argument (default: false)
* - 'stdoutLines': override command limit (default: use command limit)
*
:
*/

正如我所说,上面的命令行可以在常规终端上运行,没有错误,也没有警告,当它被放置在 Node.js 内部时,它会抛出

"erroneous pipeline syntax"

警告。非常感谢任何解决此问题的帮助。

最佳答案

不是 .js 专家 - 但我认为:

args:     ["uridecodebin","silent=true","uri=rtsp://192.168.x.x:8800/test.stm","!","queue","! fdsink fd=0"]

应该是:

args:     ["uridecodebin","silent=true","uri=rtsp://192.168.x.x:8800/test.stm","!","queue","!","fdsink","fd=0"]

我认为您错过了一些 ",

关于node.js - 需要将 rtsp 视频输出定向到 stdout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55754695/

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