Register
It is currently Thu Apr 24, 2014 7:30 pm

Video merge script with gui


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Fri Feb 06, 2009 4:47 pm   

Joined: Fri Feb 06, 2009 4:33 pm
Posts: 2
Hello, what I would like is a script to allow me to select files to join and then run them in the order I select them through mencoder to join them. I have hacked together a script using pieces of other scripts I have found but it probably is not very efficient or the best way to do it. The other thing is my script doesn't seem to work if there are spaces in the path to any of the files. Here is my hacked up script. Maybe someone could suggest changes or just write up a new one real quick. I am not sure if I needed the filetype prompt but I figured just in case I would put it in. Thank you.

Code:
#! /bin/bash
LIMIT=`zenity --entry --text="" --title="How Many Files?"`
a=0
while [ $a -lt "$LIMIT" ]
do
a=$(($a+1))
FILE=`zenity --file-selection --title="Select File Number "$a""`
echo "$FILE" >> /home/anthony/Desktop/testing
done
output_type=`zenity --title="What File Type?"  --list --separator=" " --column="Output to..." "avi" "mpeg"`
szSavePath=`zenity --file-selection --title="Save As" --save --confirm-overwrite`
mencoder -oac copy -ovc copy $(cat /home/anthony/Desktop/testing) -of $output_type -o "$szSavePath" | (zenity --progress --pulsate --text="Joining" --auto-close )
zenity --info --title="" --text="Finished


Top
 Profile  
 PostPosted: Sat Feb 07, 2009 7:12 am   
Site Admin
User avatar

Joined: Sun May 15, 2005 9:36 pm
Posts: 657
Location: Des Moines, Iowa
Code:
#! /bin/bash
LIMIT=`zenity --entry --text="" --title="How Many Files?"`
a=0
while [ $a -lt "$LIMIT" ]
do
a=$(($a+1))
FILE=`zenity --file-selection --title="Select File Number "$a""`
echo "$FILE" >> /home/anthony/Desktop/testing
done
output_type=`zenity --title="What File Type?"  --list --separator=" " --column="Output to..." "avi" "mpeg"`
szSavePath=`zenity --file-selection --title="Save As" --save --confirm-overwrite`
mencoder -oac copy -ovc copy ${(cat /home/anthony/Desktop/testing)} -of ${output_type} -o ${szSavePath} | (zenity --progress --pulsate --text="Joining" --auto-close )
zenity --info --title="" --text="Finished


I think ${(cat /home/anthony/Desktop/testing)} - I haven't tried it though. Otherwise, you could do another loop through the items when processing.


Top
 Profile WWW  
 PostPosted: Sat Feb 07, 2009 9:53 am   

Joined: Fri Feb 06, 2009 4:33 pm
Posts: 2
When I tried that I get this response:

./test.sh: line 13: ${(cat /home/anthony/Desktop/testing)}: bad substitution

I was actually thinking about trying some kind of loop instead of using a temp file and cat but haven't gotten around to figuring out how I would do it yet. Would I still need to make a temp file to do the loop or would I be able to save the selections as individual variables or something? Any advice would be appreciated. Thank you.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 12 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:  


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