My Opera is closing 1st of March

M.I.T = Multimedia IT dept.

Subscribe to RSS feed

Make Podcast with Perl and Ruby

, ,

1) Convert your videos to valid mp4 files with a Ruby script.

http://thomer.com/howtos/mp4ize

This ruby script (version 2009-11-05) does all of this automatically for you.
It figures out the aspect ratio of the movie you're trying to convert and
inserts the blacks bars at the top and bottom. If the movie is narrower than
it is high, it inserts the padding on the sides. You should use the script as
follows:
mp4ize movie1.avi movie2.asf movie3.mpg ...
In this example, the output files will be named movie1.mp4, movie2.mp4, and
movie3.mp4.
If you are converting to the iPhone, you should also include the --iphone
argument as follows:

mp4ize --iphone movie1.avi movie2.asf movie3.mpg ..

2) Make initial RSS feed for Podcast

$ vi wolfrss.xml
<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0">

<channel>
Hour of the Wolf
<link>http://www.hourwolf.com</link>
<description>Science Fiction Talk Radio
with Jim Freund</description>
<generator>WBAI Stream Capture
using Linux shell tools</generator>
</channel>
</rss>

3) Modify the RSS with Perl script when you have new videos posted!!

$ vi autocast.sh
#!/bin/bash
# catchthewolf - capture "Hour of the Wolf"
FILE=/var/ftp/pub/podcast/2010_cableMOD_0712_50sec_dv-db-10.mp4 # Where to
save it
MYURL=my.podcast.com/podcast/2010_cableMOD_0712_50sec_dv-db-10.mp4

# For the RSS syndication
XML="/var/ftp/pub/podcast/wolfrss.xml" # file for the RSS feed
ITEMS=15 # Maximum items in RSS list
XTITLE="Hour of the Wolf - $DATE Broadcast"
XDATE=`date -R` # Date in RFC 822 format for RSS
i=\$i;o=\$o;m=\$m # replace "$" in the perl script

# Add a new entry in the rss file,
# keep the file to a max of $ITEMS entries,
# and change the file's date to right now.
/usr/bin/perl -e "use XML::RSS; use XML::Simple; \
$o=XML::RSS->new(version=>'2.0');
$o->parsefile('$XML');
$o->channel(lastBuildDate=>'$XDATE', \
pubDate=>'$XDATE'); \
$o->add_item(title=>'$XTITLE', \
link=>$o->{'channel'}{'link'}, \
pubDate=>'$XDATE', \
enclosure=>{url=>'http://$MYURL', \
length=>(stat('$FILE'))[7], \
type=>'video/mpeg'}, mode=>'insert'); \
pop(@{$o->{'items'}}) \
while (@{$o->{'items'}}>$ITEMS); \
$o->{encoding}='UTF-8'; $o->save('$XML');"

echo "Caught the wolf."

4) all done!!

REFERENCES:
http://www.linuxjournal.com/article/8171?page=0,1
http://www.apple.com/itunes/podcasts/
February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28