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.
5 comments:
This is very useful, thanks. Just a note, I think you should use "-ab 128000", because otherwise you get:
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Giorgio,
Thanks for the comment, I'll make a note.
Ubuntu users reading this should note that they will need to install the ffmpeg and libavcodec-extra-52 packages from medibuntu first.
https://help.ubuntu.com/community/Medibuntu
out_file=`echo "$in_file" | sed 's/\.\w*$//'`
out_file=`echo "$out_file" | sed 's/$/\.mp3/'`
suggest above mod for files w/o extensions
Post a Comment