Skip to content

Instantly share code, notes, and snippets.

@scottopell
Last active December 10, 2017 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottopell/788917c9982bed1ff969122b58ed5710 to your computer and use it in GitHub Desktop.
Save scottopell/788917c9982bed1ff969122b58ed5710 to your computer and use it in GitHub Desktop.
Audio archive/management/conversion for audiobooks/podcasts

Scenario

You have a large audio file that has been split into multiple mp3s.

Goal

You want to merge these and convert to a m4a (optional) so that you can use it with https://github.com/scottopell/audiobook-podcast

Steps:

# Combine MP3s
ffmpeg -i "concat:$(ls *.mp3 | tr '\n' '|')" -acodec copy out.mp3

# Convert to m4a (if desired, most podcast players actually support mp3 natively)
# Command is from here: https://superuser.com/a/370637/506167
# Lots of extra details at the above link
ffmpeg -i input.mp3 -c:a aac output.m4a

Bonus Round:

The podcast template I'm using also requires some metadata for the final audio file.

How to get duration

ffmpeg -i out.mp3

How to get size in bytes

ls -l out.mp3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment