Roland0 wrote:
> build option
> You could build a static version of ffmpeg with all audio codecs
> included on another ARM machine (or cross compile it), and copy it to
> your Pi.
I was afraid that would be the case!
Oggenc, from the latest vorbis-tools (1.4.0), is doing the job perfectly
for me, so I don't think I'll be attempting to build my own ffmpeg. My
transcoding script is currently working its way through the flac files
in my library and making oggs in a mirrored folder. After almost a day,
I'm up to 'G' in the alphabet. I'm using a spare Pi 3B+ which isn't
doing anything else at the moment, so I'm happy to leave it working.
Each album flac takes about the same time to transcode on the Pi as it
did to rip in the first place. Once it's done I'll tweak the script to
do the cue files, and then the folder artwork, and finally all the lossy
files that just need to be copied over rather than transcoded.
My transcoding script works on a single file, but is invoked with the
'find -iname *.flac' command, so will work through the list of all flac
files that that command finds. It skips the transcoding if the ogg file
already exists, so in fact I'll be able to run it as another cron
process on a regular basis, just like the rsync backup. That'll mean I
always have an up-to-date full backup and an up-to-date compressed
mirror, and I'll be able to update my portable flash drive copy from the
compressed mirror at any time with a single rsync command.
Here's my current script. I'm not particularly practiced at scripting,
so others may see better ways of doing the same, but it might be useful
to someone.
Code:
--------------------
# script to convert input FLAC file to OGG
# $1 = filename of FLAC file - doesn't matter whether absolute or relative
path
# $2 = Part of absolute path to remove
# $3 = New absolute path to prepend
# e.g. ./flac2ogg.sh /mnt/MusicBackup/Music/flacs/somefile.flac
/mnt/MusicBackup/Music /mnt/MusicBackup/MusicOgg
# will produce /mnt/MusicBackup/MusicOgg/flacs/somefile.ogg
# use with 'find' command as follows: (-iname = case insensitive)
# sudo find -iname *.flac -exec /home/tc/flac2ogg.sh {}
/mnt/MusicBackup/Music /mnt/MusicBackup/MusicOgg ";"
# find full path of input file
infile=$(realpath "$1")
# path to remove from start of input
pathremove="$2"
# path to prepend
pathprepend="$3"
# remove input path
outfile=${infile#$pathremove}
# prepend new path
outfile="$pathprepend$outfile"
# get extension
ext="${infile##*.}"
# replace extension with 'ogg' (allows for any Case, such as flac, FLAC, Flac
etc)
# not really needed with oggenc (which replaces the extension automatically),
# but this allows writing to tmp file and then renaming to ogg file
tmpfile=${outfile%$ext}tmp
outfile=${outfile%$ext}ogg
#extract full path of output file
outpath=$(dirname "$outfile")
#make directory for output path. -p = ignore 'exists' errors and create
parent directories
mkdir -p "$outpath"
# convert input flac to output ogg
# only do conversion if output ogg doesn't already exist
if [ ! -f "$outfile" ];
#then echo $outfile
#then flac --decode --stdout "$1" | lame -h --preset standard -
"$outfile"
#then ffmpeg -i "$infile" -b:a 128k "$outfile"
# encode to tmp file, then rename to OGG: means the script can be stopped at
any time and restarted
# without having to clear up a partially finished OGG file (because any
partially finished tmp file will be overwritten)
then oggenc -q 5 "$infile" -o "$tmpfile"
mv "$tmpfile" "$outfile"
fi
--------------------
------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=110496
_______________________________________________
ripping mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/ripping