Skip to main content
Topic: Bash Script: Flac to vorbis transcode (Read 7206 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Bash Script: Flac to vorbis transcode

Hi, I would appreciate some help with a bash script for converting flac to ogg vorbis. I know there are already lots around, as well as many specific tools, but I have not had any success so far, despite many hours of googling - and my own linux skills are limited.

None of the existing scripts have worked for me so far. What I am trying to do:

- on linux (debian)
-using a script (not a gui), take a large library of flac files, organised into /artist/album/files, and transcode them to a separate ogg vorbis directory
-maintain all existing tags when transcoding
-of course, maintain the directory structure

I would appreciate any pointers to scripts others have used successfully. Thanks in advance.

Re: Bash Script: Flac to vorbis transcode

Reply #1
I was going to suggest Caudec, but that doesn't seem to exist any more.

Re: Bash Script: Flac to vorbis transcode

Reply #2
I was going to suggest Caudec, but that doesn't seem to exist any more.

Thanks yes I found that on here but it seems to have gone away...I also found brutha on here but that didn't work on my laptop for some reason. From other sources I found eg perl audio converter but again that didn't work for me. That's also why I am looking for a simple bash script which I can at least try to understand :)

Re: Bash Script: Flac to vorbis transcode

Reply #3
Theory
You can do a 2step process to avoid overcomplicated scripting
A. Use cp with s switch (symlinks) to copy the flac dir structure to new location
B. Find & encode those symlinks, files dest the same as src (irc oggenc should take flacs directly?) Example script.
C. Optionaly delete those flac symlinks.

Practice
https://youtu.be/YFcw6H8ht1A
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

Re: Bash Script: Flac to vorbis transcode

Reply #4
Thank you that was extremely helpful. Building on your suggestion I have successfully tried this:

Code: [Select]
#create directories and symlinks
cp -rs ~/Music/FLAC ~/Music/vorbis

#change directory to vorbis directory
cd ~/Music/vorbis

#encode symlinks to vorbis q6 using oggenc and parallel
find . -lname "*.flac" | parallel --gnu oggenc -q6 {}

#Remove symlinks
find . -lname "*.flac" -exec rm {} \+
find . -lname "*.jpg" -exec rm {} \+


I realised that I was creating symlinks to the album art files - I need to figure out how to copy them over next.

Re: Bash Script: Flac to vorbis transcode

Reply #5
Probably converting jpges from symlinks to regular files (with another find) could be the answer (That would be before you delete them).
http://stackoverflow.com/questions/8377312/how-to-convert-symlink-to-regular-file
PANIC: CPU 1: Cache Error (unrecoverable - dcache data) Eframe = 0x90000000208cf3b8
NOTICE - cpu 0 didn't dump TLB, may be hung

 
SimplePortal 1.0.0 RC1 © 2008-2018