{"id":9730,"date":"2005-12-03T01:14:04","date_gmt":"2005-12-02T22:14:04","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/2005\/12\/03\/castoggsh-make-podcasts-smaller\/"},"modified":"2005-12-03T01:17:06","modified_gmt":"2005-12-02T22:17:06","slug":"castoggsh-make-podcasts-smaller","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2005\/12\/03\/castoggsh-make-podcasts-smaller\/","title":{"rendered":"castogg.sh &#8211; make podcasts smaller"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>As you might know, podcasts are like radio shows recorded and distributed digitally (read: mp3 and RSS).  Since pretty much anyone can record a show and distribute it over the Internet &#8211; everyone and their brother do that.<\/p>\n<p>The file sizes of some podcasts are huge.  There are shows that last for more than an hour and include pieces of music and stereo special effects.  I&#8217;ve seen this eat up more than 50 MBytes each.<\/p>\n<p>Since I only have a 128 MByte memory card (and about 20 of those MBytes are eaten by software intallations and other data), I was looking at ways to minimize the file sizes of the podcasts that I wanted to listen to.  <\/p>\n<p><!--more--><\/p>\n<p>As the first step I found a general-purpose mp3 to Ogg converter (<a href=\"http:\/\/faceprint.com\/code\/\">mp32ogg<\/a>).  I had a directory with about 15 podcasts from different sources that I was doing my tests at.  The total disk space used by all mp3 podcasts was about 380 MBytes.  After I converted them to Ogg Vorbis with mp32ogg.pl same shows were occupying 350 MBytes.  An improvement, but not significant.<\/p>\n<p>After some poking around and looking here and there I realized what was the main problem.  Most of these mp3s were of a far better quality (read: bitrate) than I needed.  Some were even 256 kbit\/s &#8211; sound level that is impossible to enjoy using my phone&#8217;s headphones.<\/p>\n<p>I tried a few different bitrates and stopped at 64 kbit\/s.  This one is both good enough on the quality side (considering the factors) as well as small enough for my phone.  I converted my test samples to 64 kbit\/s Ogg Vorbis files and now all those files needed only a 250 MBytes of disk space.  Not that&#8217;s a 130 MBytes improvement.  Good enough for me.<\/p>\n<p>All that I needed to do was to automate the procedure.  And so I did with this really simple shell script.<\/p>\n<pre>\r\n#!\/bin\/bash\r\n\r\n# What bitrate to use for the resulting Ogg files\r\nBITRATE=64\r\n\r\n# Process all files with .mp3 extension\r\nfor FILE in *.mp3\r\ndo\r\n    # Give some progress feedback\r\n    echo Processing \"$FILE\"\r\n    # Convert mp3s to WAVs and write to STDOUT\r\n    mpg321 -w - \"$FILE\" | \\\r\n    # Convert WAVs coming from STDIN to Ogg Vorbis\r\n    oggenc - -b $BITRATE -o `basename $FILE .mp3`.ogg\r\ndone\r\n<\/pre>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>As you might know, podcasts are like radio shows recorded and distributed digitally (read: mp3 and RSS). Since pretty much anyone can record a show and distribute it over the Internet &#8211; everyone and their brother do that. The file sizes of some podcasts are huge. There are shows that last for more than an &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2005\/12\/03\/castoggsh-make-podcasts-smaller\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">castogg.sh &#8211; make podcasts smaller<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,6,18],"tags":[1960,616,886],"keyring_services":[],"class_list":["post-9730","post","type-post","status-publish","format-standard","hentry","category-general","category-linux","category-programming","tag-command-line","tag-filesystem","tag-podcasting"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":9716,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/11\/30\/large-files-via-bluetooth-to-sony-ericsson-p800\/","url_meta":{"origin":9730,"position":0},"title":"Large files via Bluetooth to Sony Ericsson P800","author":"Leonid Mamchenkov","date":"November 30, 2005","format":false,"excerpt":"I've got myself a little Bluetooth USB adapter and now I can easily beam files to my phone. No need to use expensive (and slow) GPRS connection for file transfers anymore. There is a problem though that I am not sure how to fix. You see, transferred files appear as\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10436,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/08\/28\/memory-memory-memory\/","url_meta":{"origin":9730,"position":1},"title":"Memory, memory, memory","author":"Leonid Mamchenkov","date":"August 28, 2006","format":false,"excerpt":"One of the greatest things about my new P910i phone is that it supports an additional memory card of up to 1 GByte. My old P800 had a limit of 128 MBytes and that was way too low, considering my podcasting needs. Today I passed by Computer World shop and\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9319,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/08\/09\/daily-del-icio-us-bookmarks\/","url_meta":{"origin":9730,"position":2},"title":"Daily del.icio.us bookmarks","author":"Leonid Mamchenkov","date":"August 9, 2005","format":false,"excerpt":"Shared bookmarks for del.icio.us user tvset on 2005-08-08 Podcasting -- Wikipedia entry Tagged as: audio blog blogging computers history ipod mp3 music pda podcasts radio reference rss syndication tools web wiki wikipedia xml \u00d0\u201d\u00d0\u00b8\u00d1\u20ac\u00d0\u00b5\u00d0\u00ba\u00d1\u201a\u00d0\u00be\u00d1\u20ac\u00d0\u00b8\u00d1? \u00d0\u00bf\u00d0\u00be\u00d0\u00b4\u00d0\u00ba\u00d0\u00b0\u00d1?\u00d1\u201a\u00d0\u00be\u00d0\u00b2 \u00e2\u20ac\u201d RussianPodcasting -- \u00d0\u00bf\u00d0\u00b5\u00d1\u20ac\u00d0\u00b2\u00d1\u2039\u00d0\u00b9 \u00d1\u20ac\u00d0\u00be\u00d1?\u00d1?\u00d0\u00b8\u00d0\u00b9\u00d1?\u00d0\u00ba\u00d0\u00b8\u00d0\u00b9 \u00d0\u00bf\u00d0\u00be\u00d0\u00b4\u00d0\u00ba\u00d0\u00b0\u00d1?\u00d1\u201a-\u00d1\u201a\u00d0\u00b5\u00d1\u20ac\u00d0\u00bc\u00d0\u00b8\u00d0\u00bd\u00d0\u00b0\u00d0\u00bb Tagged as: audio podcasts radio rss russia russian search\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10002,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/03\/23\/daily-del-icio-us-bookmarks\/","url_meta":{"origin":9730,"position":3},"title":"Daily del.icio.us bookmarks","author":"Leonid Mamchenkov","date":"March 23, 2006","format":false,"excerpt":"Shared bookmarks for del.icio.us user tvset on 2006-03-22 Fedora Core 5 Installation Notes -- Excellent collection of instructions to configure Fedora Linux 5 into a usable workstation. Tagged as: fedora howto linux reference resources Wireless Encryption - WEP, WPA, and WPA2. Tagged as: encryption security wep wifi wireless wpa wpa2\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12568,"url":"https:\/\/mamchenkov.net\/wordpress\/2010\/05\/18\/video-games-podcasts\/","url_meta":{"origin":9730,"position":4},"title":"Video games podcasts","author":"Leonid Mamchenkov","date":"May 18, 2010","format":false,"excerpt":"I have to agree with OnThisIsland.com on this one: Podcasts are not very popular in Cyprus. It probably has a lot to do with the fact that there is no puplic transport to provide someone with a great opportunity to use any means possible to shut everything and everyone out\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9932,"url":"https:\/\/mamchenkov.net\/wordpress\/2006\/02\/24\/daily-del-icio-us-bookmarks\/","url_meta":{"origin":9730,"position":5},"title":"Daily del.icio.us bookmarks","author":"Leonid Mamchenkov","date":"February 24, 2006","format":false,"excerpt":"Shared bookmarks for del.icio.us user tvset on 2006-02-23 Russell Beattie Notebook - Serialized eBooks via RSS Tagged as: atom ebooks feeds ideas reading rss syndication Educational podcasts from famous universities. at shershnev.net -- MIT, Berkley, Harward Tagged as: education listen mp3 podcasts sound university","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=9730"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9730\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=9730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=9730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=9730"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=9730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}