Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Container for multiple lossy tracks in one file? (Read 1246 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Container for multiple lossy tracks in one file?

Is there a container format that can be used for storing multiple lossy tracks in one file? I am trying to organize my library.

For lossless, a single FLAC file can hold multiple FLAC-encoded tracks, and a single M4A file can hold multiple ALAC-encoded tracks.
Are there any container formats that support doing something like this? Hopefully without transcoding the original lossy tracks.

Re: Container for multiple lossy tracks in one file?

Reply #1
Do you mean sequentially or concurrently? Ogg Vorbis and Opus files can be concatenated, this is called Ogg chaining.
Music: sounds arranged such that they construct feelings.

Re: Container for multiple lossy tracks in one file?

Reply #2
Matroska audio (.mka)
Are you looking for a GUI muxer or are you OK with CLI? For CLI, use ffmpeg.
Example:
ffmpeg -i "audio.flac" -i "audio.aac" -map 0:a -map 1:a -c copy "test.mka"
For GUI use MKVToolNix.

MPEG-4 Part 14 (MP4) (.mp4) also supports this.
Again, I would use ffmpeg for CLI and YAMB with MP4Box for GUI. Alternative for GUI is also DVBPortal MP4Muxer.
ffmpeg -i "audio.mp3" -i "audio.aac" -map 0:a -map 1:a -c copy "test.mp4"
lame -V 0

Re: Container for multiple lossy tracks in one file?

Reply #3
Yes, but you are missing chapter markers in mka, and without them, foobar (or VLC) will play only 1st song. I've tried to do that with MKVToolBox, but failed to find the automatic way to create chapters for the album, for example.
Error 404; signature server not available.

Re: Container for multiple lossy tracks in one file?

Reply #4
mkvmerge can automatically create chapters when merging files.
When running this batch file in directory with *.mp3 files, they will be merged into one mka with chapters.
Code: [Select]
chcp 65001
cd /d "%~dp0"
@echo off &setlocal enabledelayedexpansion
set "line="
for %%a in (*.mp3) do set line=!line! +"%%~a"
"C:\Program Files\MKVToolNix\mkvmerge.exe" --generate-chapters when-appending -o "output.mka" %line:~2%
Files names should not contain symbol ^.

Re: Container for multiple lossy tracks in one file?

Reply #5
Works as a charm - now, to find a way to read song titles and put them into chapter names... :)
Error 404; signature server not available.