SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2015-08-30 11:38:35

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

[SOLVED] Another flac conversion script problem

Hi guys, I need your help please. I was wanting to try out the new (to me) opus audio file format, but I am struggling to create the files.

My flac files are stored in /$artist/$album/filename format on a headless server, so no gui solutions, and any conversion script needs to operate recursively. I have been able to convert files ok but am struggling to specify the output folder.

I started with a basic conversion of files in one directory and output them to the same directory:

for i in *.flac; do opusenc "$i" "$i.opus"; done

I then amended this to output to a specified output directory:

for i in *.flac; do opusenc "$i" "/home/phil/opus/$~/i.opus"; done

But I need to get down the folder structure - the following will recurse but still outputs to the input directory

find -name "*.flac" -exec ffmpeg -i {} -acodec libopus {}.opus \;

Any suggestions how this could be amended to include a specific output destination folder would be much appreciated. I have tried pacpl but I could not get it to work with opus sad

Thank you.

Last edited by hooliganshark (2015-09-01 09:26:25)


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

Be excellent to each other!

#2 2015-08-30 13:52:19

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: [SOLVED] Another flac conversion script problem

Last edited by johnraff (2015-08-30 13:54:12)

Offline

#3 2015-08-30 15:02:15

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

Re: [SOLVED] Another flac conversion script problem

Thanks for the link John - will study that. I had considered conversion then subsequently moving the opus files, but I am afraid the hard drive will run out of space smile so I need to convert and output to the right location at the same time.


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

#4 2015-08-30 18:27:05

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,643

Re: [SOLVED] Another flac conversion script problem

From what I can tell cp -r does keep dir structure as well, so to avoid over complicated scripting (and conserve disk space), you could do it in fazes:

a. cp -r ZZWard /destination/
(should give you /destination/ZZWard with all the subfolders/files)
b. find/convert everything in there, delete flacs
c. goto a.

Another more interesting option (I never actually tested that) would be

a. cp -rs AllTheFlacs /destination/
b. find/convert everything in there, delete flacs (symlinks)
c. done

-s should make symbolic links for files, but real directories on the destination (taking almost none of the precious disk space).

Last edited by brontosaurusrex (2015-08-30 19:19:24)

Offline

#5 2015-08-30 22:08:17

hhh
Cityspeak
Registered: 2010-08-04
Posts: 3,253

Re: [SOLVED] Another flac conversion script problem

pacpl -t opus *.flac

Offline

#6 2015-08-31 10:44:45

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

Re: [SOLVED] Another flac conversion script problem

Thanks everyone - still working through these ideas. I did want to use this as an opportunity to learn a bit more about bash so johnraff's link is keeping me busy (I'm a slow learner) - but, I need a solution so the other ideas are still needed and appreciated.

@brontosaurusrex - I hadn't thought of symlinks - i will try that as well as soon as I can thank you.

@hhh yes I agree that pacpl should do this, I just found the installation a bit challenging, since the version in the repos doesnt support opus yet. I will try this as well, thanks.

Will report back on progress.


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

#7 2015-08-31 11:29:39

hhh
Cityspeak
Registered: 2010-08-04
Posts: 3,253

Re: [SOLVED] Another flac conversion script problem

Offline

#8 2015-08-31 16:17:15

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

Re: [SOLVED] Another flac conversion script problem

Thanks @hhh - I tried again with pacpl using your link. This time installation was straightforward. and things worked as expected.

pacpl -t opus -r /inputfolder --outdir /outputfolder

All ok but I noticed that the bitrate was too high till I changed the bitrate defaults in /etc/pacpl/pacpl.conf.

The only issue is that the tags are not carried over smile which is weird because the opus encoder does this by default.

Last edited by hooliganshark (2015-08-31 17:11:33)


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

#9 2015-08-31 16:41:12

hhh
Cityspeak
Registered: 2010-08-04
Posts: 3,253

Re: [SOLVED] Another flac conversion script problem

pacpl -t mp3 --delete --bitrate 192 *.flac

Offline

#10 2015-08-31 17:18:36

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

Re: [SOLVED] Another flac conversion script problem

Thanks I did that too with the bitrate. The "-to" in the code snippet was a typo on here but thanks for pointing it out, I fixed it.

I really have to fix the tagging problem though -as it stands its not a solution for me because it needs to work on thousands of files. (Though as I type this I am finding that rockbox is not playing nice with opus files and keeps freezing and crashing sad )

But I really like pacpl so thank you for helping me get it installed and working - will keep at this tonight.


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

#11 2015-08-31 19:28:08

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,643

Re: [SOLVED] Another flac conversion script problem

Last edited by brontosaurusrex (2015-08-31 22:14:02)

Offline

#12 2015-09-01 09:28:05

hooliganshark
#! Member
Registered: 2014-09-13
Posts: 50

Re: [SOLVED] Another flac conversion script problem

Marked this as solved for now as there are 3 solutions here which I am working through. Thank you for all the help.


With thanks to the creators of #!  -  OMV  -  OSMC  -  Debian

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo