When FFmpeg fails to join clips, first find out whether it failed to create a valid file or whether YouTube later rejected or flagged a file that plays locally. Use the concat demuxer for compatible inputs when you want to avoid re-encoding; use the concat filter when you need to normalise mismatched clips.
Those are separate jobs from preparing a live encoder output. A joined file can be sound while the later YouTube ingest has a codec, keyframe, audio, or delivery problem. Diagnose each stage in order rather than changing several settings at once.
Find where the failure happens
Keep the first meaningful FFmpeg error, the command you ran and the input file names. Later messages often report consequences of an earlier problem, so begin with the first error that explains why FFmpeg stopped or produced unexpected output. Note whether the command exited unsuccessfully, completed but produced a file that will not play, or created a playable file that YouTube does not accept or reports as unhealthy.
Probe each input separately before joining it. For example:
ffprobe -hide_banner -i part1.mp4
ffprobe -hide_banner -i part2.mp4
This gives you a baseline for the streams FFmpeg sees, not a guarantee that the clips are intact. Compare the stream count and order, video and audio codec names, time bases, dimensions, frame rates, pixel formats, sample rates, channel layouts and reported durations. If the inputs differ in a way the chosen method cannot handle, do not keep retrying stream copy as though it were a repair operation.
Look for clues in the error. Messages about stream mismatch, codec parameters or time bases point towards incompatible inputs for the concat demuxer. A missing file, an unreadable path or a malformed concat list points instead to the input list or filesystem. A successful command followed by a black frame, silence or a jump at the join calls for playback and timestamp checks. If only YouTube raises an issue, move to the ingest diagnostics after validating the local file.
Choose the method for the job
FFmpeg has three concat approaches, but they are not interchangeable. The concat demuxer joins packets from compatible inputs without re-encoding. The concat filter places decoded segments into a filter graph and is appropriate when you need to re-encode or normalise properties such as resolution. The concat protocol joins files at a lower, file-level layer and is suitable only in relatively limited container cases; it is not a general method for joining MP4 clips.
| Method | Use it when | Main constraint |
|---|---|---|
| Concat demuxer | Inputs have matching stream structures and you want stream copy | The streams, codecs and time bases must be compatible; duration metadata affects placement |
| Concat filter | Inputs need decoding, normalisation or re-encoding | Build a graph for the actual streams, align timestamps, and choose output parameters |
| Concat protocol | You have verified a supported file-level concatenation case | It does not make arbitrary containers or differing streams compatible |
Avoid choosing by command length. The demuxer is often the simpler route for matching clips, and it avoids a generational encode. The filter takes more setup and processing, but lets you make mixed sources consistent. If your source is a playlist intended to run continuously rather than one joined file, the workflow is different; the guide to running a video playlist continuously on YouTube Live covers that distinction.
Check compatibility before stream copy
The demuxer expects the inputs to have the same streams, codecs and time bases. In practical terms, two files with video and stereo AAC audio are not automatically compatible just because both end in .mp4. Check that their stream structure and parameters are consistent, and pay attention to any difference in duration reporting. FFmpeg's concat demuxer documentation describes the stream requirements and how timestamps are adjusted across files.
A mismatch is a decision point. If one clip is 720p and another is 1080p, or one has no audio while another has an audio stream, packet-level joining will not perform the conversion or stream design you need. Select a filter-and-encode workflow, or prepare the clips individually into a common format first. Do not assume -c copy can scale, change frame rate, convert audio or create a missing stream.
Treat reported duration as evidence to verify, not an unquestionable fact. A truncated file or inaccurate duration metadata can make the next segment start at the wrong point. Check whether the last frame and audio of each clip are present and whether playback duration matches what you expect. For a long devotional, ambience or study loop, a small defect repeated at every join becomes more noticeable over time, so inspect the actual transition rather than relying on the file names or export settings.
Use the concat demuxer for compatible clips
Create a plain UTF-8 text file, for instance list.ffconcat, with one file entry per input:
ffconcat version 1.0
file 'part1.mp4'
file 'part2.mp4'
When you want automatic format detection, the header must be the exact first line, without a byte-order mark or extra whitespace. Keep the list and media files together and use relative paths where possible. Paths containing spaces or special characters need quoting and escaping according to the concat script syntax; a list parsing error is not the same as an incompatible media stream.
Then run the demuxer with stream copy:
ffmpeg -f concat -i list.ffconcat -c copy output.mp4
This command does not re-encode or make mismatched files compatible. If it completes, check the output anyway. A successful exit means FFmpeg wrote a file; it does not prove that all frames, audio and transitions are correct, nor that YouTube will accept a later live transmission.
The demuxer normally restricts paths to safe relative file names. The -safe 0 option permits arbitrary names and protocols, but use it only when you trust the list and its paths. Prefer safe relative paths for a hand-built local list. Do not put untrusted list content into a command that grants broader path or protocol access.
If duration metadata is wrong or unavailable, the concat list supports duration directives to override a file's reported duration. Use one only after checking the real duration: a guessed value can move the following segment's timestamps incorrectly. When you see a gap or overlap, investigate duration and stream lengths before adding directives to mask the symptom.
Use the concat filter when clips need re-encoding
The concat filter is the suitable route when inputs need normalisation. Each segment should start at timestamp zero, and corresponding streams need compatible parameters. The filter can select common pixel and sample formats, but it does not automatically decide every editorial choice: resolution, frame rate, audio layout and output codecs may need explicit conversion. FFmpeg's concat filter documentation explains the input requirements and filter behaviour.
For illustration, this is a video-only skeleton for two clips. Adapt the dimensions, frame rate, encoding choices and stream mapping to your actual files:
ffmpeg -i part1.mp4 -i part2.mp4 \\
-filter_complex "[0:v]scale=1920:1080,fps=30,setpts=PTS-STARTPTS[v0];[1:v]scale=1920:1080,fps=30,setpts=PTS-STARTPTS[v1];[v0][v1]concat=n=2:v=1:a=0[v]" \\
-map "[v]" -c:v libx264 -pix_fmt yuv420p output.mp4
This intentionally omits audio and will discard it. It is not a general audio-video command. If the clips contain audio, inspect those streams and make an explicit decision: include corresponding audio streams in a synchronised concat operation, normalise them to a common format, or mix and edit them separately. Avoid joining video and audio independently without checking that their durations and starts remain aligned; a difference at a seam can produce a visible or audible sync shift.
Different source frame rates can result in variable-frame-rate output. If your intended live workflow needs a consistent frame rate, choose and apply one deliberately, then inspect the encoded result. Re-encoding adds processing time and another lossy generation if you use lossy settings, so keep the original sources and test a short representative join before processing a full programme.
Inspect timestamps and transitions
The demuxer resets the first input's timeline to zero and places later inputs according to the previous file's duration. It adjusts timestamps globally, not as an independent repair of every audio and video stream. Unequal stream lengths can therefore leave gaps, and inaccurate duration metadata can shift a later clip. If a transition has a freeze, repeat, silent patch or sudden jump, note its time and inspect the clip boundary and duration reporting around that point.
With the filter route, each segment must start at zero. setpts=PTS-STARTPTS is a common way to reset video timestamps in a filter graph; audio may need its own timestamp treatment. A reset does not repair missing frames or mismatched editorial timing. Check whether the source itself begins with a delay, whether audio starts later than the picture, and whether the end of one stream extends beyond its partner.
Inspect more than a single frame near the seam. Play several seconds before and after each join, listen on headphones if audio matters, and check for a black flash, repeated frame, silence, click or abrupt change in loudness. A devotional programme may need a deliberate crossfade where the source edits are abrupt; a straightforward concat preserves the cut rather than smoothing it. For radio-style programmes, the advice on streaming audio to YouTube Live with a visualiser is useful when the audio track, rather than video continuity, is the main concern.
Validate the output before YouTube ingest
First confirm that the output exists and has plausible duration and streams. Probe it with ffprobe, then play it from beginning to end if practical, or at least sample the start, each transition and the end. Check that the expected video and audio streams are present, seek works, and there is no truncated ending. For a long file, create a short test from representative source clips and validate that before you spend time encoding the whole set.
Then treat the live transmission as another test. YouTube's encoder settings guidance lists settings for RTMP/RTMPS workflows, including supported video and audio codec choices, frame-rate guidance up to 60 fps, constant bitrate guidance and a recommended two-second keyframe interval with a four-second maximum. These are published settings, not a promise that any particular joined file or encoder setup will be accepted. Check the current page for the resolution and frame-rate row relevant to your stream.
Use the protocol guidance for the protocol you have selected. YouTube's streaming protocol comparison distinguishes RTMP/RTMPS from HLS and DASH; codec and latency choices are not interchangeable across them. A file prepared for one workflow does not automatically satisfy another protocol's ingest requirements.
If the local file is sound but YouTube reports an issue, read the Live Control Room health diagnostics. YouTube's Live Streaming API configuration issue reference includes labels for unsupported codecs, missing audio or video, open GOP and video starvation. Use the named issue to investigate the encoder or delivery path. Do not keep changing the concat command when the file has already passed local checks and the warning points to a later stage.
For a 24/7 channel, decide where you want the joined file to run and what recovery looks like. If a local computer must stay on to deliver the programme, a power cut or restart can interrupt it; the practical steps in recovering an always-on stream after a power cut in India address that separate risk. Once the file is prepared, StreamNeo can remove the need to keep your own computer running the uploaded programme, which is useful when the remaining worry is a local machine dropping out overnight rather than the concat itself.
Before committing, compare the operating options on the pricing page. When the file and channel are ready, start free — 24-hour trial, no card.
FAQ
Can I fix every concat error by using -c copy?
No. Stream copy avoids re-encoding, but it does not make differing codecs, stream layouts, time bases or resolutions compatible. Use it when the inputs meet the demuxer's requirements; otherwise normalise and encode with a filter workflow.
Is the concat protocol the same as the concat demuxer?
No. The demuxer reads a list of media files and joins their streams under compatibility requirements. The concat protocol joins at the file level and only works in limited container cases, so it is not a universal MP4 join method.
My output plays locally. Why is YouTube still warning me?
Local playback checks the file, while YouTube's health status checks the incoming live stream and its configuration. Review the named diagnostic, encoder settings and selected ingest protocol; a valid local file alone does not establish that the live feed is configured correctly.
Should I re-encode all clips before combining them?
Only if there is a reason, such as incompatible streams or a need to standardise resolution, frame rate or audio. Re-encoding can make inputs consistent, but it takes processing time and may reduce quality; test a representative join and inspect both picture and sound before preparing the full programme.