When splitting big mp3 files (like audiobooks) into digestible chunks (say 20 minutes) with ffmpeg, there are several things to keep in mind:
- It really, really matters where you put the -ss option on the command line! If you use it as an output option (i.e. after -i), input is read but discarded, so you end up with a file containing silence at the start. You have to use it as an input option (i.e. before -i) to get the proper result.
- Same goes for -t, only that you have to use this one as an output option (i.e. after -i but before the output file name. Also note that -t denotes a duration, not a position!
- If you want to transfer the split files to an Android device, you need to adjust the IDv3-tag “title”. Android uses that plus the original extension as the display file name. If the title-tag does not contain some string to differentiate files, you end up with identical file names. So you have to fix the title to something like “audiobook – 01 of 37”. Of course the track-tag is ignored (why bother with something so obvious 🙁 ).
But do not fret. I put this all together in a quick and dirty quick and dirty perl script. First argument is the input file, second the base for output file names and third the base for the title tag:
$ splitmp3.pl "Big Input file.mp3" "Output file" "Name"
outputs files like this:
Output file - 01.mp3 Output file - 02.mp3 ...
with titles like this:
Name - 01 of 37 Name - 02 of 37 ...
That’s all, folks!