- Ubuntu – How to convert AC3 6ch audio to HE-AAC? GUI solution
- Best Answer
- Nero AAC Encoder usage
- Nero AAC quality setting
- Advice for codec and quality choice on multichannel audio
- Appendix: neroAacEnc help file
- ffmpeg audio format conversions
- Install ffmpeg on major Linux distros
- Audio conversion examples
- WAV – Waveform Audio File Format
- wav to mp3
- wav to ogg
- wav to aac
- wav to ac3
- OGG – Free, open standard container
- ogg to mp3
- ogg to wav
- ogg to aac
- ogg to ac3
- AC3 – Acoustic Coder 3
- ac3 to mp3
- ac3 to wav
- ac3 to aac
- ac3 to ogg
- AAC – Advanced Audio Coding
- aac to mp3
- aac to wav
- aac to ac3
- aac to ogg
- Closing Thoughts
- Related Linux Tutorials:
- NEWSLETTER
- WRITE FOR US
- TAGS
- FEATURED TUTORIALS
- LATEST TUTORIALS
Ubuntu – How to convert AC3 6ch audio to HE-AAC? GUI solution
I want to convert the audio track of a MKV file to HE-AAC (AAC+/AACplus). The audio track is AC3. But there seems no GUI for HE-AAC encoding? I only found out there is a Command Line Tool (CLI) from Nero, but I don’t know if this can do HE-AAC.
Any help? Any recommendation for a GUI that can convert AC3 to HE-AAC? Also should be able to handle surround sound (5.1/6-channels).
Best Answer
Nero AAC Encoder usage
neroAacEnc does support HE-AAC and HE-AAC v2 via -he and -hev2 parameters.
This encoder is (still?) considered to be the best encoder quality wise. Nero offers it free of charge but doesn’t give support for it. One problem you will encounter with large files like 5.1 WAV is the file size limitation. It is not due to this encoder being crippleware, but how to handle large numbers in a program. To workaround this you need to pipe the input with another program to the encoder and use the -ignorelength parameter. If you input format is already WAV the following should work:
cat $myfile | neroAacEnc -q 0.5 -he -ignorelength -if - -of $myencodedfile
You can also use avconv (formerly known as ffmpeg , now forked and with the CLI tool being renamed) to do the conversion to WAV.
avconv -i $myfile -f wav - | neroAacEnc -q 0.3 -he -ignorelength -if - -of $myencodedfile
Note that the resulting file is a MP4 with a AAC stream in a MP4 container, not a raw AAC stream. You can extract the raw stream with MP4Box from the gpac package if you want to.
Nero AAC quality setting
The quality setting depends on the profile you use. With LC-AAC you can go up to -q 1.0 . HE-ACC is limited to -q 0.5 , I think, and HE-AAC v2 even lower. This is due the techniques behind those profiles that are centered around low bitrates. Using -q 0.5 will result in a file larger than common AC3 6ch audio from a DVD, using -q 0.3 will cut the file size in half.
Advice for codec and quality choice on multichannel audio
The situation is (still?) really messy, which is why there exist no easy to use GUI like Handbrake. The most efficient codec is HE-AAC v2 but it is not well supported in Ubuntu, due to licensing/patent issues in some countries. Vorbis is good too, but less efficient. Multichannel mapping should be fixed in the latest LTS release (12.04, it wasn’t in 10.04). Leaving out MP3, AC3 comes in third place. FLAC is 4th on efficiency and the most supported lossless format. DTS is a complete looser and should be also left out, like MP3. Convert to FLAC if you can.
So if you have AC3 encoded audio, you probably leave it at that if the device and container format supports it. The chart for supported media formats on Android might be helpful.
Appendix: neroAacEnc help file
Usage: neroAacEnc [options] -if -of Where: : Path to source file to encode. The file must be in Microsoft WAV format and contain PCM data. Specify - to encode from stdin. Note that multiple input files can be specified, they will be encoded together into a single output file with chapter marks indicating source file divisions. : Path to output file to encode to, in MP4 format. ==== Available options: ==== Quality/bitrate control: -q : Enables "target quality" mode. is a floating-point number in 0. 1 range. -br : Specifies "target bitrate" mode. is target bitrate in bits per second. -cbr : Specifies "target bitrate (streaming)" mode. is target bitrate in bits per second. When neither of above quality/bitrate options is used, the encoder defaults to equivalent of -q 0.5 Multipass encoding: -2pass : Enables two-pass encoding mode. Note that two-pass more requires a physical file as input, rather than stdin. -2passperiod : Overrides two-pass encoding bitrate averaging period, : in milliseconds. : Specify zero to use least restrictive value possible (default). Advanced features / troubleshooting: -lc : Forces use of LC AAC profile (HE features disabled). -he : Forces use of HE AAC profile (HEv2 features disabled). -hev2 : Forces use of HEv2 AAC profile Note that the above switches (-lc, -he, -hev2) should not be used; optimal AAC profile is automatically determined from quality/bitrate settings when no override is specified. -ignorelength : Ignores length signaled by WAV headers of input file. Useful for certain frontends using stdin.
ffmpeg audio format conversions
The ffmpeg software is a free and open source suite of utilities that facilitate audio and video media. On Linux systems, installing ffmpeg gives us access to the ffmpeg command, which can be used to convert audio files to various types, such as wav, mp3, ogg, etc.
In this guide, we will go over the instructions to install ffmpeg on major Linux distros. Then, you’ll see various command line examples that can be used to convert between different audio formats. Use the examples below to convert your own files.
In this tutorial you will learn:
- How to install ffmpeg on major Linux distros
- How to use ffmpeg in audio conversion examples
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Any Linux distro |
Software | ffmpeg |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions | # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user |
Install ffmpeg on major Linux distros
Before we dive into the conversion examples below, you’ll need to install ffmpeg on your system. The software is available on all major Linux distros and can be easily installed using your system’s package manager. Use the appropriate command below to install it on your own computer.
To install ffmpeg on Ubuntu, Debian, and Linux Mint:
$ sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm $ sudo dnf install ffmpeg
To install ffmpeg on CentOS, AlmaLinux, and Red Hat:
$ sudo dnf install --nogpgcheck https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm $ sudo dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-8.noarch.rpm $ sudo dnf install ffmpeg
To install ffmpeg on Arch Linux and Manjaro:
Audio conversion examples
Check out some of the audio conversion examples below to see how ffmpeg can convert your files to different formats. We’ve compiled some of the most common options here. Note that ffmpeg has many additional quality settings and other options. It’s recommended to check out the man page and include the necessary flags in your commands.
WAV – Waveform Audio File Format
wav to mp3
Convert wav to mp3 with ffmpeg:
$ ffmpeg -i audio.wav -acodec libmp3lame audio.mp3
wav to ogg
Convert wav to ogg with ffmpeg:
$ ffmpeg -i audio.wav -acodec libvorbis audio.ogg
wav to aac
Convert wav to acc with ffmpeg:
$ ffmpeg -i audio.wav -acodec libfaac audio.aac
wav to ac3
Convert wav to ac3 with ffmpeg:
$ ffmpeg -i audio.wav -acodec ac3 audio.mp3
OGG – Free, open standard container
ogg to mp3
Convert ogg to mp3 with ffmpeg:
$ ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3
ogg to wav
Convert ogg to wav with ffmpeg:
$ ffmpeg -i audio.ogg audio.wav
ogg to aac
Convert ogg to aac with ffmpeg:
$ ffmpeg -i audio.ogg -acodec libfaac audio.aac
ogg to ac3
Convert ogg to ac3 with ffmpeg:
$ ffmpeg -i audio.ogg -acodec ac3 audio.ac3
AC3 – Acoustic Coder 3
ac3 to mp3
Convert ac3 to mp3 with ffmpeg:
$ ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3
ac3 to wav
Convert ac3 to wav with ffmpeg:
$ ffmpeg -i audio.ac3 audio.wav
ac3 to aac
Convert ac3 to aac with ffmpeg:
$ ffmpeg -i audio.ac3 -acodec libfaac audio.aac
ac3 to ogg
Convert ac3 to ogg with ffmpeg:
$ ffmpeg -i audio.ac3 -acodec libvorbis audio.ogg
AAC – Advanced Audio Coding
aac to mp3
Convert aac to mp3 with ffmpeg:
$ ffmpeg -i audio.aac -acodec libmp3lame audio.mp3
aac to wav
Convert aac to wav with ffmpeg:
$ ffmpeg -i audio.aac audio.wav
aac to ac3
Convert aac to ac3 with ffmpeg:
$ ffmpeg -i audio.aac -acodec ac3 audio.ac3
aac to ogg
Convert aac to ogg with ffmpeg:
$ ffmpeg -i audio.aac -libvorbis audio.ogg
Closing Thoughts
In this guide, we saw how to install the ffmpeg suite on major Linux distros, then use the ffmpeg command to convert audio files between different formats. Our examples contained some of the most common formats, but many more exist, and the ffmpeg software is packed with options. You can adapt our examples to your own needs, while customizing your commands with further options found in the ffmpeg man pages.
Related Linux Tutorials:
Comments and Discussions
NEWSLETTER
Subscribe to Linux Career Newsletter to receive latest news, jobs, career advice and featured configuration tutorials.
WRITE FOR US
LinuxConfig is looking for a technical writer(s) geared towards GNU/Linux and FLOSS technologies. Your articles will feature various GNU/Linux configuration tutorials and FLOSS technologies used in combination with GNU/Linux operating system.
When writing your articles you will be expected to be able to keep up with a technological advancement regarding the above mentioned technical area of expertise. You will work independently and be able to produce at minimum 2 technical articles a month.
TAGS
FEATURED TUTORIALS
- VIM tutorial for beginners
- How to install the NVIDIA drivers on Ubuntu 20.04 Focal Fossa Linux
- Bash Scripting Tutorial for Beginners
- How to check CentOS version
- How to find my IP address on Ubuntu 20.04 Focal Fossa Linux
- Ubuntu 20.04 Remote Desktop Access from Windows 10
- Howto mount USB drive in Linux
- How to install missing ifconfig command on Debian Linux
- AMD Radeon Ubuntu 20.04 Driver Installation
- Ubuntu Static IP configuration
- How to use bash array in a shell script
- Linux IP forwarding – How to Disable/Enable
- How to install Tweak Tool on Ubuntu 20.04 LTS Focal Fossa Linux
- How to enable/disable firewall on Ubuntu 18.04 Bionic Beaver Linux
- Netplan static IP on Ubuntu configuration
- How to change from default to alternative Python version on Debian Linux
- Set Kali root password and enable root login
- How to Install Adobe Acrobat Reader on Ubuntu 20.04 Focal Fossa Linux
- How to install the NVIDIA drivers on Ubuntu 18.04 Bionic Beaver Linux
- How to check NVIDIA driver version on your Linux system
- Nvidia RTX 3080 Ethereum Hashrate and Mining Overclock settings on HiveOS Linux
LATEST TUTORIALS
- Enabling SSH on Raspberry Pi: A Comprehensive Guide
- Boot Your Raspberry Pi from a USB: A Tutorial
- Checking Your Raspberry Pi’s OS Version
- Install an OS on Your Raspberry Pi: Step-by-Step
- Finding Your Raspberry Pi’s IP Address: A Quick Guide
- Easy Steps to Update Your Raspberry Pi
- Connecting Your Raspberry Pi to Wi-Fi: A How-To
- How to install RealVNC viewer on Linux
- How to check Raspberry Pi RAM size and usage
- How to check Raspberry Pi model
- Understanding UEFI and BIOS in Relation to Linux Nvidia Driver Installation
- How to orchestrate Borg backups with Borgmatic
- How to monitor filesystem events on files and directories on Linux
- Debian USB Firmware Loader Script
- How to install and self host an Ntfy server on Linux
- How to backup your git repositories with gickup
- How to bind an SSH public key to a specific command
- Creating a Bootable USB for Windows 10 and 11 on Linux
- How to list all displays on Linux
- List of QR code generators on Linux