/ Home

synconvert

gitlab

I had a compressed music library from ripped CDs using iTunes.
I used an rsync script to sync this with portable devices and flash drives.

I wanted to have the library on my NAS be lossless (FLAC).
I didn't want the overhead of lossless music on the portable devices.

I looked for a program to sync and transcode but I couldn't find one.
So I wrote this.


Features


Usage

To initialize a transcoded copy, use a terminal to navigate to the directory that will contain the transcoded target library [tgt] and run the following:

synconvert init

This will create a .syconvert file containing this:

# Copy 'Album Artist' metadata to 'Artist'
#aa2a=no

# The encoded bitrate (in kbps)
#bitrate=256

# The encoded codec
#codec=aac

# The path to the source library
#library=

# What types to convert (transcode)
#convert=flac,wav

# What types to copy
#copy=aac,mp3

# The encoded sample rate
#samplerate=44100

# Simultaneous encodes (0 to match cores)
#threads=0

# Files created here before moved to tgt
#tempdir=
    

This config file defines the rules from the transcoding and syncing. Each line is preloaded with the default value. The only one you need to set is 'Library'.

aa2a 'Album Artist to Artist' - The transcoded copy will have the value of the Album Artist tag copied to the Artist tag. This is for vehicles that don't read the Album Artist tag and create a new artist for evey song that is 'feat' someone else.
bitrate The bitrate of the transcoded copy.
codec [aac, mp3, or vorbis] The codec of the transcoded copy.
library The path to the source directory.
convert [flac, aac, mp3, vorbis, wav] The file types to convert
copy [flac, aac, mp3, vorbis, wav] The file types to be copied.
samplerate The sample rate of the transcoded copy.
threads The number of parallel encodes. Leaving it at 0 will spawn as many threads as the number of cores on the system.
tempdir The path to a temp directory where the files will be transcoded to and then moved one at a time to the target library. This is to reduce the number or parallel writes to the target drive. If it is left blank, the transcoded files will just be directly written to the target drive.

To validate the config file run this:

synconvert config

To do a 'dry run' to see what needs to be done, do this:

synconvert compare

To update the [tgt] library, run this:

synconvert update