{"id":140,"date":"2015-12-27T15:04:13","date_gmt":"2015-12-27T14:04:13","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=140"},"modified":"2016-11-27T00:50:28","modified_gmt":"2016-11-26T23:50:28","slug":"splitting-big-mp3-files","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=140","title":{"rendered":"Splitting big mp3 files"},"content":{"rendered":"<p>When splitting big mp3 files (like audiobooks) into digestible chunks (say 20 minutes) with ffmpeg, there are several things to keep in mind:<\/p>\n<ol>\n<li>It <em>really, really<\/em> matters where you put the -ss option on the command line! If you use it as an output option (i.e. <em>after<\/em> -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. <em>before<\/em> -i) to get the proper result.<\/li>\n<li>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!<\/li>\n<li>If you want to transfer the split files to an Android device, you need to adjust the IDv3-tag &#8220;title&#8221;. 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 &#8220;audiobook &#8211; 01 of 37&#8221;. Of course the track-tag is ignored (why bother with something so obvious \ud83d\ude41 ).<\/li>\n<\/ol>\n<p>But do not fret. I put this all together in a quick and dirty <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/wp-content\/uploads\/2015\/12\/splitmp3.pl_.txt\" rel=\"\">quick and dirty perl script<\/a>. First argument is the input file, second the base for output file names and third the base for the title tag:<\/p>\n<pre>$ splitmp3.pl \"Big Input file.mp3\" \"Output file\" \"Name\"<\/pre>\n<p>outputs files like this:<\/p>\n<pre>Output file - 01.mp3\r\nOutput file - 02.mp3\r\n...<\/pre>\n<p>with titles like this:<\/p>\n<pre>Name - 01 of 37\r\nName - 02 of 37\r\n...<\/pre>\n<p>That&#8217;s all, folks!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=140\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Splitting big mp3 files<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[78],"tags":[17,47,48,23],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-transcoding","tag-android","tag-audio","tag-ffmpeg","tag-mp3"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":5,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}