You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用node-rtsp-stream调用FFmpeg报错:No such file or directory

Fixing "No such file or directory" Error with node-rtsp-stream and FFmpeg

Let's break down what's causing this error and how to fix it quickly.

The root issue here is duplicate input source configuration in your node-rtsp-stream setup. The package already handles passing the RTSP stream as FFmpeg's input via the streamUrl parameter (it automatically adds the -i flag for you). But you've also manually included '-i': 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov' in your ffmpegOptions—this creates conflicting input commands for FFmpeg.

When FFmpeg runs, it ends up with two -i arguments, and the extra parameters get misinterpreted as an output file path that doesn't exist, hence the "No such file or directory" error.

Corrected Code

Remove the redundant -i entry from ffmpegOptions, and your setup will work as expected:

Stream = require('node-rtsp-stream');
stream = new Stream({
  name: 'name',
  streamUrl: 'rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov',
  wsPort: 9999,
  ffmpegOptions: {
    '-stats': '',
    '-force_fps': 30,
  }
});

Quick Tip

When using node-rtsp-stream, you never need to manually add the -i flag to ffmpegOptions—the package handles input source management through the streamUrl parameter. Use ffmpegOptions only for additional flags like -stats, -force_fps, or codec adjustments.

内容的提问来源于stack exchange,提问作者Gorka Sanz Monllor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 08:48:41