Register
It is currently Wed Nov 26, 2014 1:40 am

convert video to music only


All times are UTC - 6 hours


Post new topic Reply to topic  [ 1 post ] 
Author Message
 PostPosted: Sun Feb 13, 2011 3:03 pm   

Joined: Sun Feb 13, 2011 2:46 pm
Posts: 1
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


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP