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 existing raw aac files? (Read 1831 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Container for existing raw aac files?

What is the easiest way to put existing raw LC-AAC files into a container such as m4a?  I have several hundred 256 kbps/48 bit depth  VBR aac stream recordings from an Internet radio station which I listen to frequently.  They are superb quality but there is no way I know to add metadata tags to raw aac files, so I would like to put them in a container without decoding the audio and then re-coding it, just adding metadata.  Maybe I'm being a little too fussy about not changing the audio in the process?  I do have software (NCH Switch) for converting aac files to m4a, but it messes with the audio in the process which I would like to avoid.


Re: Container for existing raw aac files?

Reply #2
MP4Creator is also a valid option.
--------------------

Re: Container for existing raw aac files?

Reply #3
As mentioned, ffmpeg will work, but I prefer to use MP4Box (downloads). I created a (windows) script a number of years ago to do this:

Code: [Select]
:: Name:     aac2m4a.cmd
:: Purpose:  Configures mp4box to package raw aac audio into m4a file
:: Author:   jaybeee
:: Revision: June 2021 - v2

@ECHO OFF

SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

:: variables begin with v

:: set name of this script without file extension
SET vMe=%~n0

:: set name of the parent directory where this script resides
SET vParent=%~dp0

:: set location of mp4box ** CHANGE ME **
SET vmp4box="C:\Program Files\GPAC\mp4box.exe"

:: call mp4box to place all raw aac files in current directory in m4a container and save to m4a directory
MKDIR m4a
FOR %%f IN (%*) DO %vmp4box% -add %%f "m4a\%%~nf.m4a" -new

:: if you prefer to process the entire directory, then uncomment below command (remove ::), making sure to comment the above FOR command
::FOR %%f IN ("*.aac") DO %vmp4box% -add "%%f" "m4a\%%~nf.m4a" -new

:: Finish
ECHO Finished m4a creation

:: pause can be used to view the extraction details
PAUSE

:END
ENDLOCAL
ECHO ON
@EXIT /B 0

Copy and paste the above into a text file and rename it aac2m4a.cmd.
Then drag and drop the aac file(s) onto the aac2m4a.cmd file and they'll be individually (losslessly) remuxed into a m4a container and placed into a m4a directory.
Or, as you can see from the script, you can process an entire directory by double-clicking the aac2m4a.cmd after having made the changes to the script (uncomment one command and comment the other).

Simple but effective.

Re: Container for existing raw aac files?

Reply #4
What is the easiest way to put existing raw LC-AAC files into a container such as m4a?  I have several hundred 256 kbps/48 bit depth  VBR aac stream recordings from an Internet radio station which I listen to frequently.  They are superb quality but there is no way I know to add metadata tags to raw aac files, so I would like to put them in a container without decoding the audio and then re-coding it, just adding metadata.  Maybe I'm being a little too fussy about not changing the audio in the process?  I do have software (NCH Switch) for converting aac files to m4a, but it messes with the audio in the process which I would like to avoid.


Hi Thorrall! If you are referring to files with the .aac filename extension as "raw LC-AAC" files that's not what they are. They are ADTS stream files. The best way to convert them to m4a is with ffmpeg. Here is a sample conversion that includes using the appropriate filter to convert ADTS to AAC (m4a):

ffmpeg -i 1.aac -c copy -bsf:a aac_adtstoasc 1.m4a

That works great for me with AAC-LC files. It will also convert HE-AAC files but the resulting m4a will not have the proper settings to trigger HE-AAC playback. Recent versions of ffmpeg should automatically use the bitstream filter aac_adtstoasc so including that in the command is optional. In that case the command would be:

ffmpeg -i 1.aac -c copy 1.m4a

Cheers,
Phil
Cheers,
Phil

Re: Container for existing raw aac files?

Reply #5
The answers from four months ago accomplish this. And also jaybee's script can be altered to accommodate drag+drop ffmpeg'ing.
But please be careful about the phrase "convert", as it is commonly associated with transcoding.