Help need to make a shell script run for ffmpeg vhook watermaking in shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help need to make a shell script run for ffmpeg vhook watermaking in shell
# 1  
Old 09-26-2008
Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell

this is the code

Quote:
#!/bin/bash
echo "flv-watermarker converter"
vhook='/usr/local/cpffmpeg/lib/vhook'
output='/var/www/vhosts/mysite.com/httpdocs/con'
fonts='/usr/share/fonts/TrueType'
text='MYSITE.COM'
echo "$vhook - $output - $fonts - $text"
if (($# ==0))
then
echo "Usage: flvwatermarker [flv files] ..."
exit
fi
while (($# !=0 ))
do
ffmpeg -i $1 -sameq -vhook '$vhook/drawtext.so $fonts/Verdana.TTF -t $text -x 5 -y 5' $output/${1%.*}.flv
shift
done
echo "Finished with flv-watermarker converter"

the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command

this is a strange problem , if i take the ffmpeg command and run it directly from the shell promt it works, but inside this shell script it always seems to stop working around the ffmpeg part

i have other simlier shell scripts without the ' ' wrapping around parts of the ffmpeg command and they work fine, just this one seems to not work at all, i have tried adding " " to wrap the hole ffmpeg command, remove the ' ' from the vhook part, but it does not seem to work for me

i'm new to shell scripting and unix, any help or advise as to way this is not working whould be very usefull, thanks in advance

ps this was the orgianl script before i moved some commands into variables, on the ffmpeg line, to stop that long line always breaking onto two lines in nano

Quote:
#!/bin/bash
echo "flv-watermarker converter"
if (($# ==0))
then
echo "Usage: flvwatermarker [flv files] ..."
exit
fi

while (($# !=0 ))
do

ffmpeg -i $1 -sameq -vhook '/usr/local/cpffmpeg/lib/vhook/drawtext.so /usr/share/fonts/TrueType/Verdana.TTF -t MYSITE.COM -x 5 -y 5' /var/www/vhosts/mysite.com/httpdocs/con/$1.flv

shift
done
echo "Finished with flv-watermarker converter"

Last edited by wingchun22; 09-26-2008 at 07:11 PM..
# 2  
Old 09-27-2008
Single quotes prohibit expansion. If you make a variable out of the "$vhook/drawtext.so etc etc" line then you could use that variable as -vhook "${variable}" and keep things together. (Also see html/index.html and Advanced Bash-Scripting Guide)
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

3. Shell Programming and Scripting

How to make a bash or shell script run as daemon?

Say i have a simple example: root@server # cat /root/scripts/test.sh while sleep 5 do echo "how are u mate" >> /root/scripts/test.log done root@server # Instead of using rc.local to start or another script to check status, I would like make it as daemon, where i can do the following: ... (2 Replies)
Discussion started by: timmywong
2 Replies

4. Shell Programming and Scripting

how we can make shell script not to run

Hi,shell script is scheduled from maestro and we want mastero should not run shell script so can we edit the shell script so that it should run.ThanksPrakash (5 Replies)
Discussion started by: prakashdba2010
5 Replies

5. Shell Programming and Scripting

[How To?] Run shell script and get output into another shell.

Hi guys, I have a simple question, I want to store the output of the following command: As you can see it is running all the time, and we get a new line every 3sec. I just want to store these new lines into a single variable, so I can use it into a script. To clear the screen, and... (4 Replies)
Discussion started by: Thireus
4 Replies

6. Shell Programming and Scripting

please help me: how to make Ln in script shell

please can u help me in my homework, i want to creat a script shell for ln (symbolik link). This script will do everything that Ln do it. (1 Reply)
Discussion started by: halo03
1 Replies

7. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

8. Shell Programming and Scripting

How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts, I have a problem in running a shell script from my perl script (auto.pl). I run the perl script using perl auto.pl from the shell prompt The shell script picks the files in "input" folder and procesess it. The shell script blue.sh has this code. export... (16 Replies)
Discussion started by: hifake
16 Replies

9. Shell Programming and Scripting

How to run unix commands in a new shell inside a shell script?

Hi , I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell. So scenario is that - I need to have one shell script which is ran as a part of crontab - in this shell script I need to do a... (2 Replies)
Discussion started by: hkapil
2 Replies
Login or Register to Ask a Question