Adding support for AIFF & M4A exporting

I’m not that familiar with the Ardour source code so I’d start by going to the Bug Tracker and posting a feature request.

Where would you start to getting a similar change in, say, ProTools and how likely is it that you’d get it implemented and released?

I already done that :slight_smile:
Whats next?

Slowly but at the end we will just arrive to the same conclusion: opensource or classic commercial - the two side of the same coin.

@peder anyways this panner hiding is not just my wish, was proposed before, and this was Paul’s response:

How did you arrive to that conclusion??
Can you hire some guy or gal to modify the ProTools source and compile a special version for you with all the features you find absolutely essential?

What’s next is for you to wait and see if your request is deemed important enough to warrant spending time on implementing it.
If not; the beauty of open source is that you can ask or pay anyone to fix it for you

I don’t know what surround panner Sonart was talking about.
It’s not there by default in Ardout 6.9 at least.
I believe it only appears if you tell Ardour to use more than 2 output channels, and then the program, correctly IMHO, assumes that you want to use surround panning.

Did he post a feature request? This forum is for talking about things, not requesting them.

1 Like

I recommend that you use Reaper (or Bitwig, or Studio One or any of the many other fine DAWs out there that are available to you). It seems clear that you will enjoy the experience more, and their general model of developer/user interaction seems much more aligned with your own. Good Luck!

2 Likes

For this task this tool.
For that task that tool.
This is the real freedom, also known as optionality.

In general the open source proponents and believers will not be able to see the problems of the everyday users until they put aside for a moment the open source ideology, the knowledge needed for programming, the available money for the rent, and the available burnable free time on these projects. If this happens, then that will be an enlightenment for all.

Then they will see what is the problem with for example releasing ffmpeg with inferior aac encoder while claiming it is quite good, without warning the users to serious problems, and providing software built on top of this encoder, and again without warnings, suggesting it is quite good. And what is the problem with answers like build it for yourself, fix it for yourself, implement it for yourself, this the real freedom, etc…

Good, you have the option to use a different DAW. I suggest you exercise that option as rapidly as possible.

3 Likes

OK some discussions have run their course.

Please lets try to pull this back on topic for the OP’s question/comment. If I see other posts taking things off course from this topic, I will hide/delete. Thank you.

     Seablade
3 Likes

Yikes, I apologize for my request causing all of this.
Thank you for all the responses.
Was hoping for a “hey no problem, we’ll add this into Ardour 7.4” type of response :slight_smile:
Should have known better, let me tell you this deeper dive into Linux journey of mine has been rough, I was coming here to take a break from my Linux issues :slight_smile:

Okay, lots to digest here, when I have some more time I will read through a little more, I will toss out some thoughts from skimming over this thread a couple times.

-Did not know about M4A conversion issues, that makes things tricky, was unaware that FFMPEG did not handle M4A files correctly? have been using for a while (although not with Ardour), never noticed any issues, but now you got me… concerned
-Knew they had some kind of connection with AAC.
-Knew FLAC not necessarily Linux based, OGG are used in Windows programs as well but they all needed a partner to prove my point :slight_smile: Did not know they were actually a form of WAV file however.
-I am not using the Mac version of Ardour.
-Compiling is a little over my head at the moment.
-I was not aware that exporting to AIFF was possible, of course which format did I say I didn’t care about out of the two :slight_smile:

@Headwar
I was not aware of this, honestly I have never come across that dialog before. I apologize for the foolish question but
-Could you or anyone tell me how to get to this “new export format profile” dialog box?
Also
-Does anyone know what this process is doing behind the scenes?
-Is it doing a conversion if the original audio file is already an M4A file?
-Is it using FFMPEG to do the conversion?

Anyways thank you all for the responses and like Seablade said, play nice :slight_smile:

1 Like

In the export dialog (Session > Export > Export to Audio file(s)…) use “Edit” or “New” button just right of the format dropdown. See also Ardour Manual - Edit-Export-Format.

In general Ardour uses libsndfile for all audio-file import and export. see libsndfile : Supported formats . Currently the only exception is mp3.
While recent libsndfile can encode mp3, for historical reasons Ardour uses an external ffmpeg (libmp3lame) process to encode mp3.

Yes, Ardour launches ffmpeg to decode the file. During import a new lossless file (usually .wav) is created in the session-folder.

That might still happen. But the as usual, the devil is in the details. As was already pointed out, ffmpeg’s default AAC encode is not great. Adding a new export-format/codec also requires some diligence to expose relevant settings.

Meanwhile you can already export to .wav and then encode it to m4a after the fact. Either manually or using a post-export command as @Headwar pointed out above.

1 Like

Hey Robin, thank you very much for your response, that really helps to clarify things.
I have only really used Ardour for extensive testing of the program itself so exporting was not something I was doing often, could not understand where everyone was getting that dialog box but I was able to find it with your help :slight_smile:
I did not know those items under “Formats” were profiles, which explains why I didn’t know about the AIFF exporting option (again not something I need personally).
In that dialog now I also can see the external post-exporting option that Headwar mentioned.

That would great if Ardour could get AAC / M4A someday as you mentioned. Rather than having to update with a different codec I wonder if FFMPEG could just be improved upon someday which I would imagine would be a lot less work for you guys to implement (if you guys desired to at some point in the future).

I went to the FFMPEG website and it is still being developed so there is hope. Was wondering what version Ardour uses, because their website shows the following AAC/M4A updates.
https://ffmpeg.org/ under “News”

February 15th, 2016, FFmpeg 3.0 “Einstein”
The native FFmpeg AAC encoder has seen extensive improvements and is no longer considered experimental

which is obviously old but there is a more recent update as well…

January 17th, 2022, FFmpeg 5.0 “Lorentz”
The default AAC encoder settings were also changed to improve quality

Anyways again thank you for your help,
Also while I have both you guys here just wanted to say thank you to you & Paul for all the great work, really great to see all the stuff being added to Ardour :slight_smile:

It is worth noting that Ardour doesn’t typically develop support for the codecs itself, but rather depends on libsndfile for it’s native support, and utilizes ffmpeg for specific things beyond that.

To utilize ffmpeg as a commandline option to generate AAC from Ardour’s output (Render to WAV and run a command on the output via the dialog)

FFMPEG can use one of several different methods to create AAC encoded M4A files. If using fdk_aac it is perfectly fine and considered one of the better options out there. It is however something that may need to be compiled in. The ‘built in’ encoder (called simply ‘aac’ IIRC) however is not highly regarded in comparison.

For more information to understand AAC in ffmpeg: Encode/AAC – FFmpeg

Hope this helps.

Not an exact answer to your question, but if you are using the commandline processing mentioned above, it would use whatever version you have installed and point it to with the commandline.

Seablade

I believe Robin referred to FFMPEG’s AAC codec when he said " Adding a new export-format/codec also requires some diligence".

I haven’t done any comparison between the improved AAC capabilities in v5 vs fdk-aac or Apple’s codec myself but from the rumors I’ve heard it still seems to be subpar to the alternatives.
Maybe it’s good enough for many but, as seen in this thread, some people apparently require big fat “DANGER, WILL ROBINSON!!!” signs around things that aren’t absolutely top notch.

Any new format/codec really. It requires some research which bitrates make sense, what channel-combinations are available, which sample-rates are supported, how meta-data is added etc. The actual work to write source code is trivial.

Anyway, If I understand correctly the only reason why direct AAC encoding makes sense is if the target is personal use on an Apple system that runs Ardour.

FLAC, is pretty much available everywhere these days. There is native support in Windows Media Player (since Windows 10) and iOS since version 11: List of hardware and software that supports FLAC - Wikipedia

For self-hosting lossy files, while not ideal, mp3 is by far the best option.

Other than that just upload a wav (or FLAC or AIFF) to bandcamp.com (or your favorite streaming services) and let them worry about it. Those will then create the appropriate format/codec for the given target audience.

just my 2c

Ardour bundles ffmpeg v5.0 - but with limited support for encoder libraries:

ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
  configuration: --enable-gpl --enable-libmp3lame --enable-libx264
                 --enable-libxvid --enable-libtheora --enable-libvorbis
                 --enable-libspeex --enable-libbluray --enable-libgsm

Supported Audio codecs:

Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...I.. = Intra frame-only codec
 ....L. = Lossy compression
 .....S = Lossless compression
 -------
 DEAIL. aac                  AAC (Advanced Audio Coding) (decoders: aac aac_fixed )
 DEAIL. ac3                  ATSC A/52A (AC-3) (decoders: ac3 ac3_fixed ) (encoders: ac3 ac3_fixed )
 DEAIL. adpcm_adx            SEGA CRI ADX ADPCM
 DEAIL. adpcm_argo           ADPCM Argonaut Games
 DEAIL. adpcm_g722           G.722 ADPCM (decoders: g722 ) (encoders: g722 )
 DEAIL. adpcm_g726           G.726 ADPCM (decoders: g726 ) (encoders: g726 )
 DEAIL. adpcm_g726le         G.726 ADPCM little-endian (decoders: g726le ) (encoders: g726le )
 DEAIL. adpcm_ima_alp        ADPCM IMA High Voltage Software ALP
 DEAIL. adpcm_ima_amv        ADPCM IMA AMV
 DEAIL. adpcm_ima_apm        ADPCM IMA Ubisoft APM
 DEAIL. adpcm_ima_qt         ADPCM IMA QuickTime
 DEAIL. adpcm_ima_ssi        ADPCM IMA Simon & Schuster Interactive
 DEAIL. adpcm_ima_wav        ADPCM IMA WAV
 DEAIL. adpcm_ima_ws         ADPCM IMA Westwood
 DEAIL. adpcm_ms             ADPCM Microsoft
 DEAIL. adpcm_swf            ADPCM Shockwave Flash
 DEAIL. adpcm_yamaha         ADPCM Yamaha
 DEAI.S alac                 ALAC (Apple Lossless Audio Codec)
 DEAIL. aptx                 aptX (Audio Processing Technology for Bluetooth)
 DEAIL. aptx_hd              aptX HD (Audio Processing Technology for Bluetooth)
 DEAIL. comfortnoise         RFC 3389 Comfort Noise
 DEAILS dts                  DCA (DTS Coherent Acoustics) (decoders: dca ) (encoders: dca )
 DEAIL. eac3                 ATSC A/52B (AC-3, E-AC-3)
 DEAI.S flac                 FLAC (Free Lossless Audio Codec)
 DEAIL. g723_1               G.723.1
 DEAIL. gsm                  GSM (decoders: gsm libgsm ) (encoders: libgsm )
 DEAIL. gsm_ms               GSM Microsoft variant (decoders: gsm_ms libgsm_ms ) (encoders: libgsm_ms )
 DEA..S mlp                  MLP (Meridian Lossless Packing)
 DEAIL. mp2                  MP2 (MPEG audio layer 2) (decoders: mp2 mp2float ) (encoders: mp2 mp2fixed )
 DEAIL. mp3                  MP3 (MPEG audio layer 3) (decoders: mp3float mp3 ) (encoders: libmp3lame )
 DEAIL. nellymoser           Nellymoser Asao
 DEAIL. opus                 Opus (Opus Interactive Audio Codec)
 DEAIL. pcm_alaw             PCM A-law / G.711 A-law
 DEAI.S pcm_dvd              PCM signed 20|24-bit big-endian
 DEAI.S pcm_f32be            PCM 32-bit floating point big-endian
 DEAI.S pcm_f32le            PCM 32-bit floating point little-endian
 DEAI.S pcm_f64be            PCM 64-bit floating point big-endian
 DEAI.S pcm_f64le            PCM 64-bit floating point little-endian
 DEAIL. pcm_mulaw            PCM mu-law / G.711 mu-law
 DEAI.S pcm_s16be            PCM signed 16-bit big-endian
 DEAI.S pcm_s16be_planar     PCM signed 16-bit big-endian planar
 DEAI.S pcm_s16le            PCM signed 16-bit little-endian
 DEAI.S pcm_s16le_planar     PCM signed 16-bit little-endian planar
 DEAI.S pcm_s24be            PCM signed 24-bit big-endian
 DEAI.S pcm_s24daud          PCM D-Cinema audio signed 24-bit
 DEAI.S pcm_s24le            PCM signed 24-bit little-endian
 DEAI.S pcm_s24le_planar     PCM signed 24-bit little-endian planar
 DEAI.S pcm_s32be            PCM signed 32-bit big-endian
 DEAI.S pcm_s32le            PCM signed 32-bit little-endian
 DEAI.S pcm_s32le_planar     PCM signed 32-bit little-endian planar
 DEAI.S pcm_s64be            PCM signed 64-bit big-endian
 DEAI.S pcm_s64le            PCM signed 64-bit little-endian
 DEAI.S pcm_s8               PCM signed 8-bit
 DEAI.S pcm_s8_planar        PCM signed 8-bit planar
 DEAI.S pcm_u16be            PCM unsigned 16-bit big-endian
 DEAI.S pcm_u16le            PCM unsigned 16-bit little-endian
 DEAI.S pcm_u24be            PCM unsigned 24-bit big-endian
 DEAI.S pcm_u24le            PCM unsigned 24-bit little-endian
 DEAI.S pcm_u32be            PCM unsigned 32-bit big-endian
 DEAI.S pcm_u32le            PCM unsigned 32-bit little-endian
 DEAI.S pcm_u8               PCM unsigned 8-bit
 DEAIL. pcm_vidc             PCM Archimedes VIDC
 DEAIL. ra_144               RealAudio 1.0 (14.4K) (decoders: real_144 ) (encoders: real_144 )
 DEAIL. roq_dpcm             DPCM id RoQ
 DEAI.S s302m                SMPTE 302M
 DEAIL. sbc                  SBC (low-complexity subband codec)
 DEAI.. sonic                Sonic
 DEAIL. speex                Speex (decoders: speex libspeex ) (encoders: libspeex )
 DEA..S truehd               TrueHD
 DEAI.S tta                  TTA (True Audio)
 DEAIL. vorbis               Vorbis (decoders: vorbis libvorbis ) (encoders: vorbis libvorbis )
 DEAILS wavpack              WavPack
 DEAIL. wmav1                Windows Media Audio 1
 DEAIL. wmav2                Windows Media Audio 2

Okay, the last thing I needed was yet another computer problem to solve, was not expecting to open up such a can of worms with this one :slight_smile:

Now that you guys have got me concerned, I do have some more questions if anyone has some time / knowledge to share.

Okay, first off thank you all for the responses.

I don’t use a Mac, my goal was to finally be able to make a full transition into Linux from Windows, but have realized that their are a couple of basic things that I took for granted would be available that are not, my fault because I assumed, luckily I came to this realisation very deep into my Linux journey :slight_smile:

Obviously don’t know a ton about all of this stuff, so just bear with me as much as possible and try to just understand the overall idea of what I am trying to ask, don’t need crazy technical answers if possible.

Kind of strayed away from the main purpose of the request here and there.
(Keeping in mind that I don’t know all the different converting processes used by each program)
The main desire was if you have an EXISTING M4A (AAC) file, the goal was to be able to open it, edit it and save it without ever changing its format. I personally don’t have the need to necessarily save projects that are not M4A into the M4A format, I agree I would just use MP3 for that purpose if needed, although other users may still desire this.

QUESTIONS
1.) Ardour can import M4A files, when it does this does it convert the file at that point to a different format making it more (for lack of better word) “usable” then the M4A format? If it does then I guess the point is rather “moot” because no matter what the file would then have to be converted to M4A.

2.) Know this is an Audacity question, but as mentioned my current way of doing this is in Audacity (with FFMPEG).
Similar to the question above, if you open an M4A file in Audacity, does anyone know if it converts that file to a different format to use it? (All my use of Audacity use has been in Windows 64Bit if that makes any difference)

The idea is that opening, editing and saving is done as quick as possible without having to convert the results to different formats. Also not altering the quality with each conversion.

Okay don’t think that Ardour is going to be able to add this feature any time soon, so from this point in my questioning lets take Ardour out of the picture to hopefully eliminate some confusion.

Here are some general AAC / M4A / FFMPEG questions…

-I have no desire / abliity to compile FFPEG with other codecs.
-As stated above I do not notice any issues with M4A but could be how I use it (I also know I am using an older version of FFMPEG definitely before 5.0 release where they updated AAC abilities)
-All my FFMPEG / Audacity actions have been in Windows 64Bit

3.) FFMPEG - Does anyone know if the updates to AAC in version 5.0 (January 2022) improved any of the issues experienced by other users in the past? So that at least if I end up having to use FFMPEG / Audacity everything will be generally okay?

Wondering why I don’t experience any issues with M4A as mentioned by others…

4.) (For simplicity I view AAC and M4A as one in the same)
If I have an AAC file and I use FFMPEG to put that AAC file into a M4A “container” (because their is in essence no conversion time needed to do so) is FFMPEG actually using an encoding process / altering that AAC file quality in any way other than putting it into a M4A container (if using default settings of course)

5.) I read that it could depend on kbps used, when using this process mentioned above in question 4, I believe I use the default conversion so whatever the AAC uses. I think mainly around 96 or 128 kbps, not sure if any higher?
I think the issues I read about were if lower than 96 kbps and maybe issues when kbps are in higher ranges above 128 kbps but not sure. But maybe this might be another reason why I am not noticing issues?

If AAC issues still occuring with FFMPEG…
6.) Could anyone recommend a program that uses an acceptable AAC/M4A encoder.
I believe I am going to be using Windows, although I am trying hard to not give up on Linux as much as possible so will even take recommendations for Linux as well. Looking for a command line based program for Windows or Linux so something similar to FFMPEG if possible (or an actual GUI based program that offers the use of commands for command line).

Sorry for long posts, just want to make sure covering everything as much as possible.
Thank you to anyone who reads this and for any help offered.

Yes the file is decoded. Internally Ardour (really all DAWs these days) use 32bit floating point raw PCM audio.

Keep in mind that trans-coding and re-encoding (decode mp3/m4a → re-encode mp3/m4a) will increasingly degrade quality by nature of how lossy compression works. Each step of lossy compression will lower the quality.

If you load a m4a file in a soundfile-editor such as Audacity, and then save it as m4a file again, even with the same quality settings, you get a different file with slightly reduced quality.

mp3/m4a and other lossy compression is intended as last step to provide a consumer with the given audio.

4+5) If you run ffmpeg -i input.aac -c copy output.m4a then there’s no conversion. FFMPEG just wraps your AAC file into an M4A containter

The best free encoder for Windows I know of is Nero : ReallyRareWares - Nero AAC Encoder and Decoder
It has both Windows and Linux binaries
Maybe you can use iTunes as well, IDK.

You should let your ears decide whether FFMPEG 5+ has an acceptable encoder or not.

There are a few corner case exceptions, but essentially that is not possible with any perceptual codec (AAC, MP3, Vorbis, etc.). To do anything useful that would usually fall under the audio editing label involves expanding the data back to non-compressed audio, performing the edits, then re-encoding to whatever format you want for the output.
The way perceptual audio encoders work is by using a model of human hearing to determine what will typically not be perceived and not storing that data (i.e. the data is permanently discarded, not just reduced in size). When you edit the audio the original determination of what is audible or not may no longer be valid, which is why Robin pointed out that the quality degrades with each decode/edit/re-encode cycle. It is not necessarily a serious problem, and if you are doing things like editing or reworking an existing commercial recording just for fun it may be the only practical solution, but just keep in mind you would not want to intentionally make that part of your usual work flow for original or high quality recordings.

If you read carefully the release notes you pasted in, it does not state that the abilities were updated, just the default settings. You are always free to choose settings which work for your purposes different from the default.

The “issues” mentioned were just that the encoder is not the highest possible quality. That does not mean that the quality is actually objectionable, or even that the complaint applies at the settings you are using. From what I can tell from a quick read through some ffmpeg and hydrogen audio forum posts the quality differences should start to become relatively small at 192kb/s constant bit rate, so if you aren’t trying to squeeze files down to 64kb/s or 96kb/s it may be irrelevant for you.

3 Likes

Anything I put up on Youtube gets AAC encoded via ffmpeg in Cinelerra at 320kbs, Youtube has no problems handling it and by the time they re-encode it still sounds great… This is really just common sense, if you’re submitting it anywhere for reencoding you certainly don’t want to be cheap on bitrate no matter what encoder you use.

Do you know how many encoder frontends are using ffmpeg!? Even if they’re not telling you… most of them…

1 Like