parasurv@webspace ~ $

Blog: { Site updates } Linux Free Software Culture Health Watches collection Learning: Emacs Journal Linux Wiki Personal: Contact About me

Shorts: Microblog Linkblog Important: Read Watch Listen Other pages: Old games stuff

How to split mp3/audio files with ffmpeg?

I am a special kind of case among techie people. I use a dumbphone, don't have any smartdevices. I usually listen to podcasts that I download via ytp-dl, then transfer it to my phone. My phone will be 9 years old this fall, and while it has a decent music player, it doesn't remember when I paused after a while, and FF is a pain in the ass.

My favorite podcasts are sometimes 3+ hours long, so I needed to find some solutions. Maybe I could split up the mp3 file into smaller parts, so it's easier to navigate them.

I eventually found the answer with ffmpeg, which is a really handy tool for both audio and video stuff.

I like to do some of the things in terminal, so here is the command I use (Thanks to a site called Windowsloop. Ironic, I know.)

ffmpeg -i "input_audio_file.mp3" -f segment -segment_time 3600 -c copy output_audio_file_%03d.mp3

Obviously you have to enter into the directory where the files is, which you want to split. The input_audio_file.mp3 is the original filename, and you have to give the output file a name. The %03d ending make sure the files has a number at the end. The most important part is the "-segment_time" which is in seconds, so the above example means, you cut the file into 1 hour long parts.

Btw the "-c copy" means that it preserves the original file's quality.

At first I thought "let's cut it into 30 minute parts", but after a test walk, I feel like 20 minutes is a better fit.

Hosted on Neocities and created with Emacs, the world best text editor, operating system. This website doesn't track you. I don't use any javascript or other scripts. I don't store any information about the visitors. It's just pure old fashioned HTML. Some parts of the site is not up-to-date design wise. I may or may not update them in the future. I don't really support mobile stuff, but I bet if you disable the little CSS I have, you can read the site perfectly.