Skip to content
streamneo.
Setup Guides11 min read

How to Encode a Music Playlist Video with AAC Instead of MP3 Audio

Use FFmpeg to encode playlist audio as AAC, inspect inputs, choose a concat method and verify the output without assuming every file set is compatible.

sn.
StreamNeoPublished 4 October 2026
Worth sharing?

To encode a music playlist video with AAC instead of MP3 audio, tell FFmpeg to use its AAC encoder with -c:a aac. The MP3 codec in an input file does not decide the output codec: FFmpeg can decode that audio and encode it as AAC while leaving compatible video streams unchanged.

For a playlist, first inspect the files and choose a concat method that fits their streams. The commands below are starting templates, not tested recipes for every file set; check the output before using it in a live channel.

Why choose AAC for the output

AAC is an audio codec, while MP4 is a container. The filename extension alone does not tell FFmpeg which audio codec to write. Make the choice explicit with -c:a aac; if you omit a codec option, FFmpeg selects a default associated with the output muxer. The FFmpeg command-line documentation explains stream selection and codec options.

If your source audio is MP3 and AAC is required, FFmpeg must decode the MP3 packets and encode new AAC packets. That is transcoding, not a simple copy. The FFmpeg Project documentation describes transcoding as decoding a stream and encoding it again. Because this is another lossy encoding generation in the usual case, keep your best-quality source files and avoid repeating conversions unnecessarily. AAC conversion does not guarantee better sound than the source.

You may be choosing AAC because it suits the container or playback destination you have selected. Confirm the current requirements for that destination rather than treating one codec as universal. If the source already contains AAC and the destination accepts that stream, copying it may avoid an unnecessary re-encode. If the source contains MP3 and your output must contain AAC, select the encoder explicitly.

The example bitrate 192k below is illustrative, not a universal quality setting. The right choice depends on source material, channel layout and destination requirements. A higher output bitrate cannot restore information already lost in a compressed MP3. For a devotional playlist encoded from MP3 sources, for instance, making an AAC file at a larger bitrate may increase file size without recovering detail that is absent from those sources.

Check the input streams and compatibility

Before preparing a playlist, inspect each file rather than assuming that files with similar names have matching streams. Use ffprobe if it is available with your FFmpeg installation:

ffprobe -v error -show_streams -show_format track1.mp4

Look at the video and audio stream entries, their codecs, dimensions, frame rates, sample rates, channel layouts and durations. You do not need to understand every field to spot a practical mismatch: one file might have video and stereo audio, another might have no audio, and a third might have a different video size or frame rate. Record the differences that matter to the output you intend to make.

For a quick single-file test, the basic pattern is:

ffmpeg -i input.mp4 -c:v copy -c:a aac -b:a 192k output.mp4

This requests a copy of the video stream and an AAC encode of the audio stream. It is useful only when the existing video stream is suitable for the output container and the input has the streams you expect. If there are multiple audio tracks, subtitles, or no audio stream, you may need explicit stream mapping rather than relying on FFmpeg’s automatic selection.

Stream copy does not decode or encode the copied stream. FFmpeg notes that this can be fast and avoids quality loss in that stream, but it can fail if the destination container cannot carry the stream or if required information is missing. The FFmpeg documentation on transcoding and stream copy sets out that distinction. Copying video does not mean the audio is copied: in the example, audio is separately decoded and encoded as AAC.

Prepare a controlled concat playlist file

The concat demuxer reads a text playlist in sequence. A simple playlist.txt might contain:

file 'track1.mp4'
file 'track2.mp4'
file 'track3.mp4'

Keep the playlist file in a folder where paths are easy to understand. Relative paths are resolved from the working location used to run FFmpeg, so either run the command from the folder containing the listed files or write paths that are correct from your current location. Use one file line for each segment in the order you want it to play.

The demuxer is a reasonable route to try when the input files are suitable to be joined as-is and you want to avoid re-encoding video. The concat demuxer works on sequential files and adjusts timestamps; it does not make arbitrary differences between media streams disappear. FFmpeg’s concat documentation explains its demuxer and filter approaches, including why stream layouts matter.

A controlled playlist also makes the job reproducible. Give it a meaningful name, keep it beside a copy of the source files or document the paths, and check that there are no accidental duplicate entries. If the list changes, review it before rerunning the command. A missing file or a path that points to a different version of a track can produce an output that appears to have encoded correctly but is not the intended sequence.

Use FFmpeg with explicit AAC encoding

For inputs compatible with the concat demuxer and with video suitable for the target container, start with this pattern:

ffmpeg -f concat -safe 0 -i playlist.txt -c:v copy -c:a aac -b:a 192k output.mp4

The -f concat option selects the concat demuxer. -i playlist.txt names the playlist, while -c:v copy asks FFmpeg not to re-encode the video. The -c:a aac option explicitly chooses AAC for output audio. -b:a 192k is an example bitrate setting, not an official optimum for every source or listener.

-safe 0 lets the concat demuxer accept paths outside its restricted safe subset. Use it only with a playlist file you control: the playlist tells FFmpeg what files to open, so do not use an untrusted playlist as though it were harmless input. If your paths do not require this option, omit it and use the safer default where practical.

This command is a template. Depending on the actual files, FFmpeg may need explicit mapping, an explicit video encoder, different output settings, or another concat method. A successful command exit is not enough to establish that the resulting playlist has the expected audio, order and transitions. Check the output stream details and listen at segment boundaries.

If you want FFmpeg to encode video rather than copy it, omit -c:v copy only after deciding how video should be encoded. FFmpeg will otherwise choose a video encoder based on the output and its build, which may be less predictable than selecting one deliberately. Re-encoding can take longer and changes the video stream, so check the settings against the destination’s current requirements. The YouTube live encoder guidance is one place to consult for YouTube requirements; it does not make every local file combination suitable without testing.

When stream-copying video is unsuitable

Copy video only when the encoded stream can be carried in the chosen output container and the concat route can handle the inputs’ stream layouts. If FFmpeg reports incompatible parameters, or the inputs differ in ways that prevent a clean join, copying may fail or produce undesirable transitions. Copy mode cannot apply video filters, resize frames, change frame rate, or normalise differing inputs. Those operations require decoding and re-encoding the affected stream.

When re-encoding is needed, the concat filter is the usual alternative. It joins decoded streams and can be used with re-encoding and normalisation, but each input must be prepared in a compatible way for the filter graph. You may need to create consistent video dimensions, frame rates, pixel formats, audio sample rates and channel layouts first. Do not assume that switching from the demuxer to the filter automatically fixes every discrepancy; inspect the error and address the relevant difference.

A conceptual workflow is to open each input, prepare matching streams with filters as needed, join them using the concat filter, then encode the resulting video and audio. The exact filter graph depends on how many streams each file has and their properties, so a single universal command would be misleading. If all sources have markedly different layouts, normalise them in separate steps and test a short segment before building the full output.

Choice What it does Main trade-off
Concat demuxer with copied video Reads compatible files in sequence and can avoid video re-encoding Fast when inputs fit, but sensitive to stream and timestamp differences
Concat filter with re-encoding Joins decoded streams and allows filters to normalise inputs More processing and another encode, but supports changes copy mode cannot make
Re-encode one file at a time, then join Creates consistent intermediate files before joining Adds preparation work, but can make mismatches easier to diagnose

If FFmpeg rejects a demuxer command, keep the error message and use it to guide the next check. A container mismatch may call for another output container; a stream-layout mismatch may call for mapping or normalisation; a filtering requirement means re-encoding. Do not respond to every failure by adding flags at random, since that makes it harder to tell whether the files are actually suitable.

Verify the output audio stream

After encoding, inspect the output rather than inferring success from .mp4:

ffprobe -v error -show_streams -show_format output.mp4

Find the audio stream and confirm its codec is AAC. Also check that the expected video stream is present, that the duration is plausible, and that the number of audio streams is what you intended. If you used automatic stream selection and a source had multiple tracks, verify which track ended up in the output.

Listen to the beginning, the points where one playlist item changes to the next, and the end. This can reveal gaps, abrupt cuts, silence, unexpected tracks, or audio that drifts relative to video. The concat demuxer adjusts timestamps as it proceeds, but different stream lengths can leave gaps; a metadata check alone will not tell you whether a transition sounds acceptable.

For a 24/7 YouTube channel, the encoded file is only one part of the workflow. Keep a local copy of the source and output, and test the finished file in the same kind of playback path you plan to use. A prepared playlist does not by itself confirm that YouTube is receiving the expected live programme; the guide to checking whether YouTube is receiving your RTMP stream covers that separate check. For YouTube playback, also check the current official requirements rather than relying on an old encoding preset.

Common concat and path pitfalls

Paths are a frequent source of avoidable failure. A path with spaces needs correct quoting in the concat file, and a relative path only works from the expected working directory. On Windows, path separators and drive-letter syntax deserve particular care. If a file name contains an apostrophe, escaping it for concat syntax is not the same as shell quoting; consult the FFmpeg concat documentation rather than assuming ordinary command-line quoting rules apply.

The -safe 0 option relaxes the demuxer’s path restrictions, but it does not repair a misspelt path or make the playlist’s targets compatible. Keep the playlist under your control and review every referenced file. If FFmpeg says it cannot open an input, check spelling, case sensitivity, current directory and permissions before changing encoding settings.

Do not assume same extension means same streams. MP4 files can contain different video and audio codecs, dimensions, frame rates or stream counts. Conversely, a source MP3 track can be decoded and written as AAC in a suitable output, but that audio conversion does not solve a video incompatibility elsewhere in the playlist. The input audio codec does not determine the output audio codec; the selected output options do.

For a long music programme, compare the finished runtime with the intended sequence and check that all entries are present. Where files have different audio and video durations, timestamp adjustment may leave gaps. If continuity matters, consider the concat filter and explicit stream normalisation, then inspect and listen to the resulting file before it becomes the source for an always-on broadcast.

If the reason for preparing one file is to keep a channel playing after your own computer is off, separate that operational question from the encoding decision. StreamNeo removes the need to keep a local computer running the uploaded video for its 24/7 YouTube broadcast, but you still need to supply media you have checked and a channel configured for live streaming. The guide to running a 24/7 YouTube stream without your own internet discusses that operational distinction.

A playlist that is well encoded can still be unsuitable as a source if its contents are not yours to use or you have not checked the platform’s current rules. Encoding changes the media format; it does not change ownership, licensing, or YouTube’s review decisions. If your channel relies on continuous playback, test the exact output and keep enough notes to reproduce the encode when a source file is replaced. You can also review YouTube’s encoding requirements for pre-recorded live content alongside the current official documentation.

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

How do I change MP3 audio to AAC in FFmpeg?

Use an explicit audio codec option such as -c:a aac. FFmpeg decodes the source MP3 and encodes AAC for the output; it does not simply relabel MP3 packets as AAC. The result is another lossy encoding generation, so start from the best source you have.

Can I copy the video while encoding the audio as AAC?

Yes, when the video stream is compatible with the output container and the inputs can be joined appropriately. Use -c:v copy alongside -c:a aac; then inspect the output and check transitions. If video needs filtering, normalisation or a different codec for the target container, copying is not suitable.

Should I use the concat demuxer or the concat filter?

Try the concat demuxer when the inputs are suitable for sequential joining without re-encoding. Use the concat filter when re-encoding or stream normalisation is needed, while accounting for the extra processing and quality change. Neither method makes arbitrary mismatched files automatically compatible.

Does a higher AAC bitrate guarantee better sound?

No. The output bitrate is a setting, not a guarantee of improved sound, and it cannot restore detail lost in a compressed source. Choose a setting that fits the source and destination, then listen to the result rather than treating an example value as universal.

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 ↗