Here’s a quick utility to use a set list and ffmpeg to split single audio files into multiple tracks. It splits audio files via a setlist then sets the song name, artist, album id3 tags. The script is crude, but it’s a quick start.
I used this to split a couple concerts by two of my favorite artists: James McMurtry in Concert July 14 2013 and Ray Wylie Hubbard in Nashville, TN performing tracks from A. Enlightenment B. Endarkenment (Hint: There is no C). You can find the set lists below.
# use ffmpeg to split an mp3 according to a set listfrom__future__importprint_functionimportsubprocessassp# NB: add -copy if from mp3 -> mp3; else no -copysetfile='./Ray Wylie Hubbard in Concert - December 17, 2010 at Tennessee State Museum.set'mp3file='./Ray Wylie Hubbard full concert - DASH.m4a'outdir='./Ray Wylie Hubbard in Concert - December 17, 2010 at Tennessee State Museum'meta_src='https://www.youtube.com/watch?v=y9_xBIuV9nE'do_copy=Falseprint('splitting \'%s\' according to sets in \'%s\' into directory \'%s\''%(mp3file,setfile,outdir))metas={'artist':'Ray Wylie Hubbard','album':'Acoustic Live in Concert December 17 2010 at Tennessee State Museum / Hippie Jacks'}metastring=' '.join(['-metadata %s="%s"'%(k,v)fork,vinmetas.iteritems()])songs=[]withopen(setfile)asf:forlineinf:start,title=line.strip().split(' ',1)songs.append((start,title))print('read %d lines'%len(songs))# set id3 tags ala http://jonhall.info/how_to/create_id3_tags_using_ffmpegcmds=[]foriinrange(len(songs)-1):cmd=(songs[i][0],songs[i+1][0],songs[i][1])cmds.append(cmd)run='ffmpeg -i \"%s\" -acodec %s -ss %s -to %s '%(mp3file,'copy'ifdo_copyelse'libmp3lame -qscale:a 2',cmd[0],cmd[1])run+='%s -metadata title="%s" -metadata track="%d/%d" -metadata publisher="%s" '%(metastring,cmd[2],i+1,len(songs)-1,meta_src)run+='"%s/%02d.mp3"'%(outdir,i+1)# print("\tcmd: %s" % run)sp.call(run,shell=True)
You’ll have to adjust params at the top of splitter.py:
setfile is the set file
mp3file is the audio file
outdir is the output directory (you should probably mkdir this beforehand)
meta_src is the source
do_copy should be True if your source is an mp3 file and False if you want to transcode to mp3
00:00:00 chirping
00:00:48 Bayou Tortous
00:05:04 Red Dress
00:11:00 talking / tuning
00:11:52 What's the Matter Now
00:16:09 talking / real sensitive little love ballads and baptists
00:17:18 How'm I Gonna Find You Now
00:21:28 talking / buy cds
00:22:09 Just Us Kids
00:27:00 applause
00:27:27 You'd A' Thought (Leonard Cohen Must Die)
00:33:34 clapping and get ready to dance
00:33:47 Choctaw Bingo (with new verse) (introduction)
00:34:30 Choctaw Bingo (with new verse)
00:46:22 applause / belly rubbing dances
00:46:49 These things i've come to know
00:50:26 talking / introduction to the band / unfortunately song still relevant
00:51:44 We Can't Make it Here Anymore
00:58:37 talking about ice fishing and Tim Holt
00:59:37 Copper Canteen
01:04:22 talking / back to stompin' songs
01:04:41 Freeway View
01:08:03 talking / feral hogs in michigan
01:08:33 Lobo Town
01:14:00 applause
01:14:07 Restless
01:19:17 talking / goes out to memory of max crawford
01:20:02 Levelland
01:26:40 talking / thanks crowd / reminds crowd to bring whiskey / be nice to the nice officer
01:28:21 Too Long in the Wasteland
01:35:36 applause
01:35:50 Lights of Cheyenne (acoustic)
01:41:51 thanks and watch for deer (god bless wisconsin)
01:42:42 finit
00:00:00 hippie jacks intro
00:03:03 talking / rwh enters
00:03:18 Count My Blessings
00:06:43 talking / glad to be here / band on weekend work release
00:07:09 Rabbit
00:10:02 talking / get what you pay for
00:10:23 Snake Farm
00:14:14 talking / Hayes Carll / smell
00:16:18 Drunken Poet's Dream
00:20:00 talking / get more attention burning down a barn
00:21:29 Down Home Country Blues
00:24:18 talking / hardly strictly bluegrass / commitment
00:26:25 The Ballad of the Crimson Kings
00:30:57 talking / Without Love banter
00:32:40 Without Love
00:36:28 tuning
00:36:43 Dust of the Chase
00:40:50 applause / talking / tuning / remembering Mambo John Traynor
00:43:30 Name Droppin'
00:46:44 talking / ain't no rock and roll roosters
00:47:30 Rooster
00:50:12 talking / gambler and a drinker's gold bullet
00:52:35 Mississippi Flush
00:56:39 talking / no name dropping / slaid cleaves / turned it over to the da
00:59:34 Conversation With the Devil
01:03:30 talking / hard core serious hillbilly redneck country bar
01:05:37 Redneck Mother
01:09:26 talking / ralph stanley and bill monroe
01:11:00 Wanna Rock and Roll
01:14:03 talking / band should get instruments and learn to play 'em
01:15:03 The Messenger
01:19:38 talking / thank you
01:20:43 Mother Hubbard's Blues
01:27:13 thanks / post show
01:29:05 finit