| 1 | ========================================================================== |
| 2 | fdkaac - command line frontend encoder for libfdk-aac |
| 3 | ========================================================================== |
| 4 | |
| 5 | Prerequisites |
| 6 | ------------- |
| 7 | You need libfdk-aac. |
| 8 | On Posix environment, you will also need GNU gettext (for iconv.m4) and |
| 9 | GNU autoconf/automake. |
| 10 | |
| 11 | How to build on Posix environment |
| 12 | --------------------------------- |
| 13 | First, you need to build libfdk-aac and install on your system. |
| 14 | Once you have done it, the following will do the task. |
| 15 | (MinGW build can be done the same way, and doesn't require gettext/iconv) |
| 16 | |
| 17 | $ autoreconf -i |
| 18 | $ ./configure && make && make install |
| 19 | |
| 20 | How to build on MSVC |
| 21 | -------------------- |
| 22 | First you have to extract libfdk-aac source here, so that directory tree will |
| 23 | look like the following: |
| 24 | +- fdk-aac ---+-documentation |
| 25 | | +-libAACdec |
| 26 | | +-libAACenc |
| 27 | | : |
| 28 | +- m4 |
| 29 | +- missings |
| 30 | +- MSVC |
| 31 | +- src |
| 32 | |
| 33 | MSVC solution for Visual Studio 2010 is under MSVC directory. |
| 34 | |
| 35 | Available input format |
| 36 | ---------------------- |
| 37 | WAV, RF64, CAF, RAW, upto 32bit int / 64bit float format is supported. |
| 38 | Metadata in CAF info chunk can be read and copied to the resulting m4a. |
| 39 | This is especially useful and works well when you pipe from ffmpeg via CAF. |
| 40 | For example, you can copy tag from original "foo.flac" to "foo.m4a" |
| 41 | through the following pipeline: |
| 42 | |
| 43 | $ ffmpeg -i foo.flac -f caf - | fdkaac -m3 - -o foo.m4a |
| 44 | |
| 45 | Since FDK AAC encoder is implemented based on fixed point integer, |
| 46 | encoder itself handles 16bit input only. |
| 47 | Therefore, when feeding non-integer input, be careful so that input doesn't |
| 48 | exceed 0dBFS to avoid hard clips. |
| 49 | You might also want to apply dither/noise shape beforehand when your input |
| 50 | has higher resolution. |
| 51 | |
| 52 | Note that fdkaac doesn't automatically resample for you |
| 53 | when input samplerate is not supported by AAC spec. |
| 54 | |
| 55 | Tagging Options |
| 56 | --------------- |
| 57 | Generic tagging options like --tag, --tag-from-file, --long-tag allows you |
| 58 | to set arbitrary tags. |
| 59 | Available tags and their fcc (four char code) for --tag and --tag-from-file |
| 60 | can be found at http://code.google.com/p/mp4v2/wiki/iTunesMetadata |
| 61 | |
| 62 | For tags such as Artist where first char of fcc is copyright sign, |
| 63 | you can skip first char and just say like --tag="ART:Foo Bar" or |
| 64 | --tag-from-file=lyr:/path/to/your/lyrics.txt |
| 65 | |
| 66 | Currently, --tag-from-file just stores file contents into m4a without any |
| 67 | character encoding / line terminater conversion. |
| 68 | Therefore, only use UTF-8 (without BOM) when setting text tags by this option. |
| 69 | |
| 70 | On the other hand, --tag / --long-tag (and other command line arguments) are |
| 71 | converted from locale character encoding to UTF-8 on Posix environment. |
| 72 | On Windows, command line arguments are always treated as Unicode. |
| 73 | |
| 74 | Tagging using JSON |
| 75 | ------------------ |
| 76 | With --tag-from-json, fdkaac can read JSON file and set tags from it. |
| 77 | By default, tags are assumed to be in the root object(dictionary) like this: |
| 78 | |
| 79 | { |
| 80 | "title": "No Expectations", |
| 81 | "artist": "The Rolling Stones", |
| 82 | "album": "Beggars Banquet", |
| 83 | "track": 2 |
| 84 | } |
| 85 | |
| 86 | In this case, you can simply specify the filename like: |
| 87 | --tag-from-json=/path/to/json |
| 88 | |
| 89 | If the object containing tags is placed somewhere else, you can optionally |
| 90 | specify the path of the object with dotted notation. |
| 91 | |
| 92 | { |
| 93 | "format" : { |
| 94 | "filename" : "Middle Curse.flac", |
| 95 | "nb_streams" : 1, |
| 96 | "format_name" : "flac", |
| 97 | "format_long_name" : "raw FLAC", |
| 98 | "start_time" : "N/A", |
| 99 | "duration" : "216.146667", |
| 100 | "size" : "11851007.000000", |
| 101 | "bit_rate" : "438628.000000", |
| 102 | "tags" : { |
| 103 | "ALBUM" : "Scary World Theory", |
| 104 | "ARTIST" : "Lali Puna", |
| 105 | "DATE" : "2001", |
| 106 | "DISCID" : "9208CC0A", |
| 107 | "TITLE" : "Middle Curse", |
| 108 | "TRACKTOTAL" : "10", |
| 109 | "track" : "2" |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | In this example, tags are placed under the object "format.tags". |
| 115 | ("format" is a child of the root, and "tags" is a child of the "format"). |
| 116 | In this case, you can say: |
| 117 | --tag-from-json=/path/to/json?format.tags |
| 118 | |
| 119 | For your information, ffprobe of ffmpeg project (or avprobe of libav) can |
| 120 | output media information/metadata in json format like this. |
| 121 | |
| 122 | Note that not all tags can be read/written this way. |