Don's Pages and my Music

Saturday, October 16, 2010

Kevin's World: Nautilus script to create mp3s from video files

Wednesday, October 13, 2010

Nautilus script to create mp3s from video files

Do you ever download a video off youtube and think "gee I wish I had an mp3 of that". Well here is a script for nautilus (the gnome file manager in linux) to help you create that mp3.

Create the file in $HOME/.gnome2/nautilus-scripts

I named it "Convert to MP3" and set the execute flags on the script (chmod a+x $HOME/.gnome2/nautilus-scripts/Convert\ to\ MP3)

#!/bin/bash

in_file="$1"
out_file=`echo "$in_file" | sed 's/\.\w*$/\.mp3/'`

ffmpeg -i "$in_file" -f mp3 -ab 128000 "$out_file"


This script requires ffmpeg to be installed for it to work. Once you install this script you should see a new menu item on the context menu of the files named Scripts if it was not already there, and then you should see your "Convert to MP3" option.


Select any video file, choose the "Convert to MP3" option and after a few seconds (depending on the size of the file) an mp3 file will be created with the same name as the original file. 
Hope you found this useful.

Go there...
http://kdekorte.blogspot.com/2010/10/nautilus-script-to-create-mp3s-from.html

Don

No comments:

Post a Comment