Thicket data repository for the EEG
1{
2 "id": "https://www.tunbury.org/2020/04/12/music-library",
3 "title": "Music Library",
4 "link": "https://www.tunbury.org/2020/04/12/music-library/",
5 "updated": "2020-04-12T12:41:29",
6 "published": "2020-04-12T12:41:29",
7 "summary": "Using a Raspberry PI with a USB CD drive to read all my CDs and create a master, FLAC format, repository and from that create MP3 and AAC versions for the car and iTunes.",
8 "content": "<p>Using a Raspberry PI with a USB CD drive to read all my CDs and create a master, FLAC format, repository and from that create MP3 and AAC versions for the car and iTunes.</p>\n\n<div><div><pre><code>sudo apt-get install abcde\nsudo apt-get install flac\n</code></pre></div></div>\n\n<p>Then read the file with</p>\n\n<div><div><pre><code>abcde -a cddb,read,getalbumart,encode,tag,move,clean -j 4 -B -o flac -N \n</code></pre></div></div>\n\n<p>To make <code>abcde</code> create file names in the format that I prefer create <code>.abcde.conf</code> in the users’ home directory containing:</p>\n\n<div><div><pre><code>OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE}'\n\nmungefilename ()\n{\n echo \"$@\" | sed -e 's/^\\.*//' | tr -d \":><|*/\\\"'?[:cntrl:]\"\n}\n</code></pre></div></div>\n\n<p>And encode it as AAC using</p>\n\n<div><div><pre><code>ffmpeg -i \"01 - Santas Coming for Us.flac\" -c:v mjpeg -vf scale=500:500 -c:a aac -b:a 128k -threads 4 \"01 - Santas Coming for Us.m4a\"\n</code></pre></div></div>\n\n<p>This could be rolled up as followed with find/xargs</p>\n\n<div><div><pre><code>find . -name \"*.flac\" -print0 | xargs -0 -P 4 -I{} ffmpeg -i {} -c:v mjpeg -vf scale=500:500 -c:a aac -b:a 128k -n {}.m4a\n</code></pre></div></div>\n\n<p>The <code>-n</code> here causes it to skip files where the output file already exists so the command can be run again on an existing directory tree. <code>-P 4</code> forks 4 copies of <code>ffmpeg</code>.</p>\n\n<p>Finally copy it the m4a files to <code>~/Music/Music/Media/Automatically Add to Music.localized</code></p>",
9 "content_type": "html",
10 "author": {
11 "name": "Mark Elvers",
12 "email": "mark.elvers@tunbury.org",
13 "uri": null
14 },
15 "categories": [
16 "raspberrypi",
17 "flac"
18 ],
19 "source": "https://www.tunbury.org/atom.xml"
20}