A recording that plays is not a recording that is complete
The file opens. It seeks, it plays, the picture is right, and a track that was in the room is simply not in it. Nothing errored, because nothing failed — the shape of that file was decided in your own pipeline code, months earlier, by a line nobody has read since.
On this page
TL;DR: A recording missing a track is not a broken file. It opens, it seeks, it plays, and the picture is exactly right — there is simply no audio, or one of two video streams on the same source is absent, and nothing anywhere errored. The two systems we read arrive there differently: in one, a single line routes video and no line routes anything else, so the muxer is never given a second input to fill; in the other, no line says what to route at all, so a documented default keeps one stream per type and discards the rest. We ran both shapes against sources we built, and the file is not evidence that the session was captured. It is evidence that a process ran.
Every other failure at this layer announces itself: a call that never connects leaves a screen saying connecting, and a camera that cannot be opened puts an error name in front of a user. This one produces an artifact that looks like success and is handed to the archive, and the gap between what happened and what was kept opens quietly and stays open.
It surfaces months later, in the one situation where the file is the only copy left: a complaint, a review, a dispute about what was said. By then nobody can reconstruct the session, and the question "why is there no audio" has no owner, because at the time it was recorded nothing was wrong.
- The source announces a streamone pad per stream, at runtime
- The handler reads its media typea single string comparison
- video — the first onelinked to the depayloader; a second video stream hits the same silence
- anything elseno branch exists — dropped, unlogged, uncounted
Where does a track go missing?
At the moment the pipeline is built, not at the moment it runs.
Here is a recorder from one of the two systems — a GStreamer pipeline per camera, pulling RTSP and
writing MP4 segments. rtspsrc cannot know its streams in advance, so it announces each one as a
dynamic pad and the application decides what to do with it:
media = struct.get_string("media")
if media == "video":
sink_pad = depay.get_static_pad("sink")
if sink_pad is not None and not sink_pad.is_linked():
pad.link(sink_pad)Read what is not there. There is no else. An audio pad is announced, examined, found not to be
video, and dropped on the floor — not rejected, not logged, not counted. And the second condition
does the same thing again a level down: not sink_pad.is_linked() means that if the source offers
two video streams, the first one wins and the second is discarded by the same silence.
The construction step above it settles the matter before any of this runs:
video_pad = splitmuxsink.request_pad_simple("video")One pad is requested from the muxer, and it is the video one. Even if the handler had linked an audio stream there would have been nowhere to put it. The file's shape is a property of the pipeline, not of the session — which is why re-running it, on a different day, against a source that definitely has sound, produces a file of exactly the same shape.
Why does the file still play?
Because it is a completely valid file. That is not a technicality; it is the entire reason this survives review.
An MP4 with one video track and no audio track is not a damaged MP4. Its index is correct, its duration is correct, players open it, seek in it and play it — we decoded every packet of one and ffmpeg reported nothing at all. Containers record what they contain, and the format has no field that records what it was never given, because from the container's point of view nothing was missing: it wrote what it was handed.
Then there is the second layer of silence, and it is not the one you would guess. It is tempting to
say nothing decodes — the video is copied through in both systems — but that is only true of the
video: -c:v copy covers video alone, so any audio stream that is selected gets decoded and
re-encoded, and the same GStreamer file carries a second path that decodes MJPEG and encodes H.264.
There are decoders in these pipelines.
They are just not in a position to notice. A decoder complains about the stream it was handed, never about one that was never routed to it, and neither system holds any statement of what it expected to receive — so nothing anywhere has two lists to compare. We ran the unmapped ffmpeg shape against a source with eight streams and kept two: exit status 0. We ran the GStreamer shape verbose and grepped its log: no line mentioning audio, and no warning of any kind.
The absence of an error here is not a monitoring gap. Nothing failed. Every component did exactly what it was configured to do — and whether that configuration was a decision or an oversight is not visible from outside, which is the problem. Nothing in the pipeline, the logs or the file distinguishes a stream that was deliberately excluded from one nobody noticed.
- Several microphones on one sourceall of them arriving
- A command with no -mapso the tool chooses
- The stream the container marked defaultwritten into the file
- Every other microphonediscarded — and no field anywhere records the choice
Is the older system any different?
Different decade, different stack, same shape — and this one is a single line.
// reflowed to one line; the array in the source is nine
const args = ['-rtsp_transport', 'tcp', '-i', this.videoEncoder, '-c:v', 'copy',
path.join(this.path, newFilename)];No -map. When you do not map streams explicitly, FFmpeg chooses for you, and it documents exactly
how: "In the absence of any map options for a particular output file, ffmpeg inspects the output
format to check which type of streams can be included in it… For each acceptable stream type, ffmpeg
will pick one stream, when available, from among all the
inputs" — the highest-resolution video,
the audio with the most channels, and on a tie the lowest index. (The emphasis is ours.)
One per type. A source carrying two microphones — a room mic and a lapel, the two a dispute will turn on — yields a file with one of them and no record of the choice.
And the rule you would look up to predict which one is not the rule that decides. We built a
source with three audio streams, one of them 5.1, and ran that same command: the 5.1 stream lost to a
stereo one. Then we moved the container's default flag onto the 5.1 stream, changed nothing else,
and ran it again — the 5.1 stream won. Same streams, same command, one flag. So the survivor is
chosen by a disposition the container set, and the documented channel-count rule can only be what
breaks ties beneath it. An application that never set that flag, and has never read it, has still
decided which microphone it keeps.
| What the pipeline says | What decides the file's contents | What reports the difference |
|---|---|---|
| a pad handler matching one media type | the branch that has no else |
nothing |
| one muxer pad, requested at build time | the pipeline's construction, months ago | nothing |
an input with no -map |
a documented default, per stream type | nothing |
| a stream copy with no expectation | nothing holds a list to compare against | nothing |
- no -map (the shape under study)
- -map 0 (the control)
What does the system think happened?
That it recorded. Every signal it has says so, and every one of them is about the process rather than the file.
In the older system a flag is set to running once the spawn call has returned. Nothing in between looks at the child process — no exit handler, no error handler — so an ffmpeg that died on a bad source address leaves the recorder marked started. And nothing ever reads that flag back: the only guard against a double start is the presence of a child-process handle. Even the one signal the system keeps about whether it is recording is a note that a process was spawned, and it is a note nobody opens — which, like a success code on a start-recording call, describes a request rather than a file.
The newer one publishes an event for each segment as it is finalised. That is a stronger signal, in that a file exists and has a size, and it still says nothing about what is inside it.
So the honest reading of every green signal in both systems is: a recording process existed. That is worth knowing and it is not what anyone believes it means.
What does this cost the person who needs it?
Nothing at all, for months. Then everything at once, to somebody who was not in the room.
In a clinical setting the file is the record of a consultation. In a legal one it is the record of an answer. Both are consulted exactly when memory has already failed and the stakes have already risen, and both are consulted by somebody with no way to know that the file is not the session. A missing audio track does not read as a technical defect at that point. It reads as a gap in the record, and gaps in records get explanations that are much less charitable than "a pad handler had one branch".
The asymmetry is what makes it worth an afternoon: the defect costs nothing to carry and cannot be repaired retroactively. There is no re-run. The session happened once.
How would you know if this were true of you?
Do not test that recording works. Test what the file contains.
- Read your own routing, not your configuration. Find every place a stream is linked, mapped or
requested — a pad handler, a muxer pad, an
-mapargument, a subscription — and ask what happens to the inputs that match none of them. If the answer is "nothing happens", that is the defect, and it is written as an absence rather than a line. - Give every discard an
else. One log line naming the media type it did not route converts a silent decision into a searchable one. It costs nothing and it is the only artefact this failure would ever have produced. - Probe the finished file, at write time.
ffprobethe artifact as the pipeline closes it and compare its track list against what that pipeline was built to capture. Not against a roster of who should have been recorded — against your own declared intent, ten metres away in the same process. Anything that does not match is a line in a log written the same day, not a discovery made a year later. - Record one deliberately imperfect session. Two microphones, or a participant joining late, then open the result and count the tracks. A recorder tested only in the configuration on the developer's desk is tested in the one configuration where the defaults are right.
- Then ask what the archive is for. If the answer is "the only surviving account of what happened", the file deserves a check that it contains what happened.
FAQ
Is this not what the recording platform is supposed to guarantee? It was asked for this. Every system here builds its own pipeline or its own command line, and what runs underneath does what that pipeline says. There is nothing to escalate: the request was served, and the request was the problem.
Would a monitoring alert not catch a missing audio track? Only if something is looking inside files, which is a different kind of check from the ones that exist. Job status and segment counts are both healthy here — they measure that a recording happened, and the file is proof of exactly that much.
Is this the same as a composite recording that cannot be unmixed? No, and they need different remedies. A composite folds several sources into one track, so everything is present and nothing can be separated. This is a track that is not in the file at all — the opposite problem, and the one that cannot be fixed by re-processing, because the data never existed.
We reconcile our recordings against the session roster. Is that not enough? It answers a different question — which sessions were captured. It cannot see inside a file that was produced, so a session recorded with half its audio passes that check as comfortably as a complete one.
The three things worth taking away
A file's contents were decided by your code, not by the session. One pad, one branch, one missing
-map: the shape of every recording that system will ever produce was fixed before anybody joined.
Valid is not complete, and nothing in the file distinguishes them. A container has no place to record what it was never handed, so a recording with a track missing is indistinguishable, on inspection, from a recording of a session where nobody spoke.
The only check that works is on the artifact. Every signal upstream of the file describes a process; the file is the thing the archive keeps, and reading its track list back takes one command and one comparison you already have the answer to.
If your archive holds recordings nobody has opened since the day they were written, that is a cheap thing to have looked at.