thanx for one more esoup
getting mixed results with it on some of the tags
all tags good from ogg
artist and year absent from wv
artist absent from wma tta flac
not tried other formats
how would you use for bulk?
i tried this [and did fine][of course users can add formats to list]
for f in nocaseglob nullglob *.{mp3,flac,ape,wv,m4a,aac,mp4,shn,tta,wma,AOB,ogg ,mpc,tak,ac3,ts,m2ts,mkv} \
; do convert-to-m4a "$f" ; done
Linux is Latin for off-the-beaten-track
what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
Playing with Slackware too now ...
ShanArt
That script should work fine for bulk files, just use a wildcard. To convert every ogg in a directory, for example, use
I haven't tested it that much, it may well be imperfect (I got some weirdness with the artist on a flac I converted this way)... and in fact, using it on a directory of files doesn't seem to work. For now, you can enclose it in a for loop, but I can't see why that is necessary, since there's a for loop within the script itself.Code:convert-to-m4a *.ogg
A little experimenting seems to show that bash is expanding the * wildcard too early - at the variable declaration stage rather than during the for loop.
The only way I can think of to do truly universal conversion of metadata is to use avconv (or ffmpeg, if that's your preferred weapon) to copy the metadata over with -map_metadata... but unfortunately, that requires the creation of an extra file, and this will take more time. It shouldn't be a problem for a vaguely modern computer, though, and will simplify the script (and therefore any chance for mistake in writing it).
Once I've figured out how to escape the * wildcard reliably, I'll work that into the script, but for now, to do multiple files:Code:#!/bin/bash #### Requires: avconv, neroAacEnc, NeroAacTag #### Default VBR quality is 0.5 quality="0.5" mode="q" adv= usage () { echo "Usage: convert-to-m4a input.file <arguments> By default, this uses a VBR mode with the neroAacEnc tag of -q 0.5 You can set a constant bit rate with -br <bitrate> OR -cbr <bitrate> You can use any other neroAacEnc options by using -adv \"-option1 -option2\" - be sure to enclose the options in quotation marks! Advanced options and details on the encoding modes can be found in the neroAacEnc readme.txt" } #### Parse command-line options if [ $# = 0 ]; then echo "No input file stated" usage exit fi while [ "$1" != "" ]; do case "$1" in -h ) usage exit ;; -q ) mode="q" shift quality="$1" ;; -cbr ) mode="cbr" shift quality="$1" ;; -br ) mode="br" shift quality="$1" ;; -adv ) shift adv="$1" ;; * ) filename="$1" ;; esac shift done for f in "$filename"; do #### The actual conversion to AAC M4A avconv -i "$f" -vn -f wav - | neroAacEnc -if - -"$mode" "$quality" -ignorelength "$adv" -of "${f%.*}.m4a" #### Writing the metadata to the new M4A avconv -i "$f" -i "${f%.*}.m4a" -map_metadata 0 -map 1 -c copy ".123-${f%.*}.m4a" mv ".123-${f%.*}.m4a" "${f%.*}.m4a" done exit 0
Code:for a in *.file; do convert-to-m4a "$a"; done
Hi
Examples for using libfdk_aac encoder with FFmpeg.
CBR
For AAC-LC, like this:-
(Format profile : LC)
For AAC-HE, like this:-Code:ffmpeg -i foo -c:a libfdk_aac -b:a 128k -afterburner 1 -ar 44100 -ac 2 foo.m4a
(Format profile : HE-AAC / LC)
For AAC-HEv2, like this:-Code:ffmpeg -i foo -c:a libfdk_aac -profile:a aac_he -b:a 64k -afterburner 1 -ar 44100 -ac 2 foo.m4a
(Format profile : HE-AACv2 / HE-AAC / LC)
VBR[1-5]Code:ffmpeg -i foo -c:a libfdk_aac -profile:a aac_he_v2 -signaling implicit -b:a 32k -afterburner 1 -ar 44100 -ac 2 foo.m4a
There's some VBR/samplerate information in HA thread here ---> http://www.hydrogenaudio.org/forums/...3&#entry817833
(-afterburner 1 gives improved quality, it's optional)Code:ffmpeg -i foo -c:a libfdk_aac -vbr 3 -afterburner 1 -ar 44100 -ac 2 foo.m4a
Last edited by sandyd; January 7th, 2013 at 05:11 PM. Reason: Changed explicit_sbr to implicit for backwards/maximum compatibility.
You think that's air you're breathing now?
General recommendation is to use HE-AAC for low bitrates (64k and below or so); otherwise use LC-AAC. I can clearly hear a difference between HE and LC using fdk-aac.
I haven't personally performed many ABX tests, so I can't say which encoders are "better", but Kamedo's tests seem thorough enough for me. For LC-AAC, fdk-aac is absent since the blog article is almost a year old, but this blog indicates:
I'd say fdk-aac would be => NeroAacEnc, but this is just a a mostly uneducated guess and should not be considered to be a very valid statement.qaac > enc_aacPlus > NeroAACEnc > ffmpeg -c:a aac -cutoff 15000 ≒ libfaac ≒ vo-aacenc
Last edited by FakeOutdoorsman; December 26th, 2012 at 08:33 PM.
well had a "good play" with all these recently and have now got my ffmpeg so it has
DEA.L. aac
AAC (Advanced Audio Coding) (encoders: aac libfaac libfdk_aac libaacplus )
my understanding at this point [testing with my bat ears; the only true scientific way i know
if you want a normal aac/m4a/mp4 audio libfdk way better than libaac
if you want a small file [has to be below 40k to get HE-AACv2 and therefore SBR enhanced stereo]
you can get it with libaacplus or fdk [thanx Ron999 for syntax]
This below from any audio format or video to ==== > HE-AACv2 bulk or one file ... also keeps tags
fdk
for f in nocaseglob *; do ffmpeg -i "$f" -c:a libfdk_aac -profile:a aac_he_v2 -signaling explicit_sbr -b:a 38k -afterburner 1 "${f%.*}.m4a"; done
libaacplus
for f in nocaseglob *; do ffmpeg -i "$f" -c:a libaacplus -b:a 38k "${f%.*}.m4a"; done
PS i cannot stress enough how good this format is
at 38k it sounds pretty much like a flac or similar and means you can therefore email an entire archived album as one Googlemail attachment
which is amazing... if you want to share the latest exploits of your favoured HipHop hero of the moment with your great-great aunt Beryl...
Last edited by shantiq; December 28th, 2012 at 02:28 PM.
Linux is Latin for off-the-beaten-track
what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
Playing with Slackware too now ...
ShanArt
Doesn't -b:a use a fixed bitrate? Isn't it normally better to use a VBR mode targeting a quality? Unless you're doing streaming over the internet or something.
You know that it would be absolutely crazy, and certainly would never appear in the mainstream abcde script, but now I have tinkered a little with qaac (and with abcde!) it would be only a small job to add qaac support to abcde .
All abcde does is interrogate the cd, request information from cddb, rip to hdd as wav and then use the allocated encoder to convert +/- tag. Easy enough to slot a new encoder in, even if it is a windows encoder running through wine!!? The abcde engine itself does not need alteration...
You think that's air you're breathing now?
i have ripped a few files with qaac even to 320kbps
and i do not particularly rate the way they sound
i still think neroAacEnc is BEST and now fdk_aac is also really good
i hear qaac as better than libaac [but then what is not?] but nowhere near as clear or defined as 2 mentioned above
so glad i tested it [plus it is wine exe] but a tad underwhelmed
love the way it does alac thoone guy's ear-view for what it is worth...wine qaac -A --verbose -i *wav
Last edited by shantiq; December 28th, 2012 at 10:09 AM.
Linux is Latin for off-the-beaten-track
what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
Playing with Slackware too now ...
ShanArt
Bookmarks