Looking for script to convert mp3 to m4b

Come up with a useful post-processing script? Share it here!
Post Reply
LakersFan
Newbie
Newbie
Posts: 18
Joined: August 12th, 2013, 11:54 pm

Looking for script to convert mp3 to m4b

Post by LakersFan »

I really wanted to try and figure this out myself, but I'm so new to this, it's really hard for me to know where to begin. I have an unraid server and am looking to create a simple(?) bash script to take a downloaded .mp3 and convert it to .m4b (iTunes audiobook).

Ultimate goals would be:
1. rename downloaded file to input.mp3
2. convert input.mp3 to output .m4b using ffmpeg
3. rename output file to "book - then today's date" ie. "BOOK-February-2-2019.m4b"

That's it. Seems like it would be simple, right? :)

Any help will be very much appreciated.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Looking for script to convert mp3 to m4b

Post by safihre »

Do you have a program that could do that conversion?
Then we could help writing the script.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
LakersFan
Newbie
Newbie
Posts: 18
Joined: August 12th, 2013, 11:54 pm

Re: Looking for script to convert mp3 to m4b

Post by LakersFan »

Yes, ffmpeg does the conversion. I've used it in Windows and this seems to work for me:

Code: Select all

ffmpeg.exe -i %%1 -vn -c:a aac -b:a 120k -f mp4 %%1.m4b
But since Unraid is Linux based, batch files won't work.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Looking for script to convert mp3 to m4b

Post by safihre »

You could just change it to a script file (.sh) and then replace the % by $.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
LakersFan
Newbie
Newbie
Posts: 18
Joined: August 12th, 2013, 11:54 pm

Re: Looking for script to convert mp3 to m4b

Post by LakersFan »

well heck if it's that easy, i'll give it a shot. I'll be back with any issues. :)
Post Reply