Hi
first post and my first script - well first script that's worked .
I came to create this script as I had a few music videos I wanted to play on my "mp3" player, So it basically just takes the audio from the video file.
prerequisites:
zenity - to specify what to name file.
ffmpeg and appropriate libs - for what you want to convert from and to.
*note you must specify extension when asked to type the new filename. e.g. "music file.mp3"*
*also create the folder Music_from_video in home directory or amend script as you see fit*
Code:
#!/bin/bash
# zpath is destination path
zpath=$(zenity --entry --title="name of new file" --text="enter new song title")
# next line modifies the zpath to take out spaces
mod_zpath=`echo $zpath | sed 's/ /-/g'`
#runs args through ffmpeg
ffmpeg -i $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS -vn -acodec copy ~/Music_from_video/$mod_zpath | zenity --progress \
--title="FFMPEG" \
--text="Converting to sound" \
--percentage=0
if [ "$?" = -1 ] ; then
zenity --error \
--text="Update cancelled."
fi
not the most sophisticated but works for me