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

FFmpeg报错‘matches no streams Stream specifier '' in filtergraph description’的修复方案(针对仅含视频流的a.mp4音频合成命令)

Fixing the FFmpeg "matches no streams" Error When Merging Audio

Alright, let's break down what's going wrong here and fix that FFmpeg command for you.

Why the Error Happens

The error ffmpeg matches no streams Stream specifier '' in filtergraph description pops up because your first input file a.mp4 only contains a video stream, no audio stream. When you reference [0] in your filter complex, you're telling FFmpeg to target the first input's audio stream—but there isn't one. The volume, atrim, and adelay filters are all audio-only, so FFmpeg can't find a valid stream to apply them to.


Fix 1: If You Don't Need Audio from a.mp4

If your goal is just to process the audio from b.mp3 (trim it, adjust volume, etc.) and you don't actually need anything from a.mp4, simplify the command by removing the unused video input and audio references:

ffmpeg -y -i b.mp3 -filter_complex '[0]volume=1,atrim=start=0:end=5.796,adelay=0|0' mergeAudio.mp3

Fix 2: If You Need to Mix Audio (Use Silent Audio as a Placeholder)

If you intended to mix two audio streams (e.g., b.mp3 plus a silent track matching your original [0] parameters), replace the missing audio from a.mp4 with a generated silent audio stream. We'll use FFmpeg's anullsrc filter to create this placeholder:

ffmpeg -y -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i b.mp3 -filter_complex '[0]volume=1,atrim=start=0:end=5,adelay=0|0[aud0];[1]volume=1,atrim=start=0:end=5.796,adelay=0|0[aud1];[aud0][aud1]amix=2' mergeAudio.mp3

This command generates a stereo, 44100Hz silent track as the first input, giving FFmpeg a valid audio stream to apply your [0] filters to.


Quick Tip to Verify Input Streams

Next time, if you're unsure what streams a file contains, run this command to list all streams for your inputs:

ffmpeg -i a.mp4 -i b.mp3

It will clearly show whether each file has video, audio, or subtitle streams.

内容的提问来源于stack exchange,提问作者jzwb

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.30 05:52:28