Skip to content
streamneo.
Setup Guides11 min read

How to Create an FFmpeg Concat Playlist from Videos with Different Codecs for YouTube

Build an FFmpeg playlist, check stream compatibility, and choose between stream copying and re-encoding for YouTube-ready video.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

A concat playlist tells FFmpeg which files to read and in what order. It does not convert codecs or make mismatched files compatible: use stream copying only when the inputs already meet the concat demuxer’s requirements, and use the concat filter with re-encoding when they differ.

The practical workflow is to make a manifest, inspect every file, then choose the method based on what you find. For a mixed-codec playlist, decode and re-encode to a common output before sending it to YouTube Live; do not expect -c copy to repair the differences.

Create a plain-text playlist manifest

A manifest is a text file containing one file entry per input. Put the entries in the order in which you want the clips to play. For example, save this as inputs.txt:

file 'clip-one.mp4'
file 'clip-two.mov'
file 'clip-three.mkv'

The filenames and extensions are examples, not clues about the actual codecs inside the files. An MP4 can contain different video or audio codecs from another MP4, and files with different extensions can sometimes contain streams that are compatible. Inspect the streams rather than deciding from the names alone.

Where possible, keep the manifest beside the inputs and use paths relative to that directory. This makes the list easier to move and check. If you use absolute paths, quote them according to the manifest syntax and take care with apostrophes or other special characters in filenames. A filename that the manifest cannot parse will stop the job before concatenation begins.

The concat demuxer checks paths for safety by default. The example command below uses -safe 0, which allows paths that would fail those checks. Use that option only when the playlist contents are trusted; do not apply it casually to a manifest supplied by someone else. FFmpeg’s concat demuxer documentation describes the format and safe-path behaviour.

Treat the playlist as an ordered edit decision, not as an encoding recipe. If your sequence is a set of devotional readings or a repeated class programme, check that the clips begin and end where you intend. The guide to setting up a YouTube Live playlist that repeats overnight covers the separate question of arranging a recurring programme; the FFmpeg manifest here is about preparing one ordered media file.

Check each file’s streams and parameters

Use ffprobe to find out what each input actually contains. A concise inspection command is:

ffprobe -v error -show_streams -show_format clip-one.mp4

Run it on every file, not only the first. Note whether each has video, audio, or both, and record the codec names, dimensions, frame rate, pixel format, sample rate, channel layout and time base where available. Also check duration and whether the streams start at the same time. A difference in codec is an obvious mismatch, but not the only one that can matter.

Make a small comparison table for yourself before choosing a method. The goal is not to force every field to match by hand; it is to see which properties need deliberate normalisation. For example, one clip may have stereo audio at one sample rate while another has a different channel layout, or one may be vertical while the other is widescreen. Those are editorial and technical decisions, not problems a playlist solves.

If a file has no audio stream, a filter graph that assumes audio exists for every input will fail. If one clip has two audio tracks, decide which track you want rather than assuming the first is the right one. A stream list also helps you notice subtitles or data streams that should not be copied into a simple YouTube-oriented output.

A simple video montage and a long-running channel have different review needs. For a sequence that will play repeatedly, listen at the join points as well as watching them. The guide to removing a claimed song from a pre-recorded YouTube livestream loop is relevant if the content itself raises a rights issue; encoding choices do not resolve that question.

Choose the concat demuxer for compatible inputs

The concat demuxer is appropriate when the files have the same streams and compatible parameters, including codec and time base, and you want to join them without re-encoding. It reads packets from each file in turn. With stream copying, FFmpeg does not decode and re-encode those packets.

For compatible inputs, a command can look like this:

ffmpeg -f concat -safe 0 -i inputs.txt -c copy joined.mp4

This is a starting pattern, not a guarantee that any playlist will work. The container you select for the output must also support the streams being copied. Watch FFmpeg’s output for warnings about stream layouts, timestamps or unsupported data, and test the resulting file from beginning to end.

The advantage is speed and no additional generation of lossy encoding artefacts: the compressed packets are copied rather than encoded again. The trade-off is that you have little opportunity to change the streams as they pass through. If the output needs a different video codec, audio format, frame size or other processing, stream copying is the wrong operation.

FFmpeg’s stream-copy documentation explains that stream copying passes packets without decoding or encoding. The FFmpeg concat FAQ describes the filter approach for cases where re-encoding is needed. Use the demuxer because the files are compatible, not simply because it is the quickest command to try.

Understand why the manifest does not convert files

The distinction is straightforward: a manifest describes a sequence, while a codec describes how a stream is represented. Listing an H.264 clip followed by a ProRes clip does not make the latter H.264. Likewise, an audio track encoded with one codec is not transformed into another because it follows an inputs.txt entry.

The demuxer can join packets only when the streams meet its compatibility requirements. Adding -c copy asks FFmpeg to copy those packets, which specifically avoids decoding and encoding. It cannot convert one codec to another, resize an image, change a sample rate or create audio where none exists. If the input streams or parameters are incompatible, the command may fail, produce a problematic join, or yield output that does not behave as intended.

Do not treat a successful exit code as proof that the result is fit for a continuous broadcast. A file can be created while still having a freeze, audio discontinuity, timestamp jump or an unexpected track at a transition. The file needs a playback check, especially at joins.

For channels built from a rotating catalogue, make the preparation step repeatable: keep source files, the manifest and the final output clearly named, and note any conversion choices. If the playlist is part of a broader 24/7 workflow, the guide to reducing CPU use when looping videos in OBS helps distinguish the cost of preparing media from the cost of keeping a live programme running. The two are related operationally, but they are not the same FFmpeg task.

Use the concat filter for differing codecs or parameters

When clips use different codecs, or otherwise need normalising, decode them and use the concat filter, then encode the result. The filter works on decoded audio and video frames rather than copying compressed packets. FFmpeg’s FAQ says, “This operation is recommended if you need to re-encode,” referring to the concat filter.

For two inputs that each contain one video stream and one audio stream, this illustrates the basic shape:

ffmpeg -i clip-one.mp4 -i clip-two.mov \
  -filter_complex "[0:v:0][0:a:0][1:v:0][1:a:0]concat=n=2:v=1:a=1[v][a]" \
  -map "[v]" -map "[a]" \
  -c:v libx264 -crf 18 -preset medium -pix_fmt yuv420p \
  -c:a aac -b:a 192k -movflags +faststart output.mp4

This is an illustrative starting point, not a tested command for every file. It assumes both inputs have the expected video and audio streams. It also does not resolve every difference automatically. The filter’s inputs need to be suitable for concatenation; resolution, pixel format, sample rate, channel layout and frame timing may require additional filters or a deliberate choice about the output format.

For example, if a clip has a different frame size, decide whether to scale it to a common size and how to handle the aspect ratio. Scaling without considering the aspect ratio can stretch a person or crop content. If frame rates differ, decide whether to conform them and inspect the result for judder or repeated frames. For audio, resampling or changing channel layout may be needed to produce a consistent track. These are transformations you specify in the filter graph; the word concat alone does not choose them for you.

If some inputs have no audio, the simple graph above is not suitable as written. You can build a graph that supplies silence for those segments or handle audio and video concatenation separately. Similarly, if a file has several tracks, map the chosen stream explicitly. Start from the ffprobe output, make the intended treatment explicit, and test with a short set of representative clips before processing a large library.

The filter route costs more processing time because FFmpeg decodes and encodes. A lossy output codec can also introduce another encoding generation, so choose a quality setting appropriate to the material and retain the originals. In return, you can normalise differing inputs and produce a consistent output instead of asking a packet-copy operation to reconcile streams it cannot change.

Encode a common output for YouTube Live

Once the sequence is assembled, choose an output profile that suits the source and your YouTube workflow. YouTube’s recommended upload encoding settings list MP4, H.264 video, progressive scan and AAC-LC among the recommendations. The same page recommends matching the source frame rate rather than blindly changing it. Check the current page before encoding because platform guidance can change.

YouTube’s SDR bitrate table lists 8 Mbps for 1080p at a standard frame rate and 12 Mbps for 1080p at a high frame rate. These are recommendations, not mandatory minimums, and they are upload guidance rather than a promise about the right bitrate for every live workflow. The source’s detail, motion and frame rate matter. Do not upscale a low-resolution clip just to label it 1080p, and do not increase the frame rate without a reason.

A common H.264/AAC MP4 is a useful target when your inputs need conversion and the assembled file is intended for a YouTube-oriented workflow. In the example above, libx264, yuv420p and AAC express that kind of target, but the command is not a universal preset. Choose resolution, frame rate, audio layout and encoding quality based on the actual source and the current requirements for the particular YouTube path you are using.

If you are preparing a live stream, distinguish the prepared file from the live encoder’s output. A completed MP4 is not itself the stream key or a live session; it is media that your chosen broadcast workflow can send. For a channel that needs to keep a prepared programme running overnight without leaving a home computer on, StreamNeo removes the manual burden of keeping that computer and local encoder running after the file and YouTube channel are ready.

Verify the assembled stream

Check the output file with ffprobe again. Confirm that the intended video and audio streams are present, the duration is plausible, and the codec and parameters match the profile you selected. If you expected one video and one audio track, confirm that the output did not acquire extra streams or lose audio along the way.

Then play the complete file or at least a thorough review copy that includes every transition. Listen for silence, clicks, sudden changes in loudness and missing audio. Watch for black frames, frozen pictures, unwanted aspect-ratio changes, cuts in the middle of a sentence, and timestamp irregularities. A join may look acceptable in a short preview while revealing a problem a little later, so examine the seconds around each boundary.

For a playlist that will loop, also check the last-to-first transition. A technically valid file can still feel abrupt if the final clip ends with speech or music and the first starts in a different acoustic space. Adjust the edit or add an intentional pause or transition in your source preparation; concatenation will not invent one.

Finally, test the actual broadcast path with a private or otherwise appropriate test before relying on it for a scheduled channel. Confirm that the selected file plays, the sound is audible, and the live stream appears as expected in YouTube’s interface. For a local news loop, study channel or small business display, those checks are as important as the codec command because a correct file alone does not confirm the entire live setup.

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 concatenate different codecs with -c copy?

Not as a way to convert them. -c copy copies packets without decoding, so it cannot turn one codec into another. Use the concat demuxer with stream copying only when the streams and relevant parameters are compatible; otherwise use a filter and re-encode.

Is the concat playlist file the same thing as the concat filter?

No. The playlist is a text manifest read by the concat demuxer, which can join compatible input packets. The concat filter joins decoded segments in a filter graph and is the route to consider when you need re-encoding or normalisation.

What if the clips have different resolutions or frame rates?

Inspect them first, then decide on a common output size and frame-rate treatment. You may need filters such as scaling, aspect-ratio handling or frame-rate conversion before the concat filter; check transitions for cropping, stretching or uneven motion.

Which output settings should I use for YouTube?

Use YouTube’s current guidance as a reference, then account for the source material and whether you are preparing an upload or a live broadcast. MP4 with H.264 video and AAC audio is a common target, but the right frame rate, resolution and bitrate depend on the content and workflow.

YOU’VE REACHED THE END

Keep the ideas coming.

More guides, useful tools and a little help for your next broadcast.

Back to the journal ↗
YOUR NEXT READ

A little more to explore.

More Setup Guides guides ↗ · All topics ↗