andrei ka (12020-11-11):
> ffmpeg would be enuf, ffmpeg would list all the tracks in input files
> before starting transco, on failure dude should just check his first
> 20lines of log to see if mp4 have snd tracks...
Bad advice. The log output of ffmpeg is not meant to be parsed by an
application. The fact that it goes to stderr should be a hint. In
particular, there are no promises that the syntax of the list of streams
will be kept constant.
ffprobe is the right tool for this, because the output is guaranteed to
In reply to this post by FFmpeg-users mailing list
On 2020-11-10 13:27, Randy Johnson via ffmpeg-user wrote:
> When running the following command:
> ffmpeg \
> -loop 1 -framerate 30 -t 1.4 -i /assets/img/filler640480.jpg -i 0d.mp4 -
> y \
> -loop 1 -framerate 30 -t 891.113 -i /assets/img/filler640480.jpg -i
> 9f.mp4 -y \
> -f lavfi -t 0.1 -i anullsrc=channel_layout=mono:sample_rate=48000 \
> -filter_complex "
> -vsync 2 -vcodec libx264 -pix_fmt yuv420p 0245-grid.mp4
> I am getting the following error:
> Stream specifier ':a' in filtergraph description
> matches no streams.
> This only happens on some video processing not all, cannot seem to
> figure out why.
I agree with Michael Koch's earlier answer, but let me try to explain
what FFmpeg is trying to tell you.
Within a video file, each sequence of video images, and each audio
channel, is a stream. Some files might have a single video stream and a
two audio streams (stereo sound). Some might have a video stream and one
audio stream (monophonic sound). Some might have a video stream and no
audio stream at all (silent video).
FFmpeg gives you an error message, "Stream specifier ':a' in filtergraph
description … matches no streams." ":a" is a stream specifier for an
audio stream (see the documentation, under "stream_type"). Look in the
"[0:v]setsar"…"concat=n=4:v=1:a=1" code — that is your filtergraph
description — for stream specifiers ending in ":a". Those are what
FFmpeg cannot match to a stream in the input files.
As Andrei Ka points out, you can look in the FFmpeg output for a
description of what streams FFmpeg finds in the input files. I suspect
that in the cases where your invocation succeeds, FFmpeg will tell you
that each of the input files has an audio stream. In the cases where
your invocation fails, FFmpeg will tell you that at least one of the
input files has no audio stream.
If it is the case that some of your files have no audio streams, then
you have two basic choices:
1. Generate an FFmpeg invocation tailored to the details of your input
files. Don't generate instructions to concatenate audio streams for
files which have none, but do generate for files which do have audio.
2. Generate a more elaborate FFmpeg invocation which will generate
silent audio streams for input files which have none. The details of
this should be in a separate thread with a separate Subject: line.
I hope this is helpful,
—Jim DeLaHunt, software engineer, Vancouver Canada
Add a silent audio stream if no audio stream exists
Am 11.11.2020 um 21:59 schrieb Jim DeLaHunt:
> 2. Generate a more elaborate FFmpeg invocation which will generate
> silent audio streams for input files which have none. The details of
> this should be in a separate thread with a separate Subject: line.
That's an interesting question. Can this be done in one command line?
If the input video has an audio stream, then leave it as it is. If no
audio stream exists, then add silent audio.