Sponsored Content
Top Forums Shell Programming and Scripting Help need to make a shell script run for ffmpeg vhook watermaking in shell Post 302240837 by wingchun22 on Friday 26th of September 2008 06:04:45 PM
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..
 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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
ATF-SH(1)						    BSD General Commands Manual 						 ATF-SH(1)

NAME
atf-sh [-s shell] -- interpreter for shell-based test programs SYNOPSIS
atf-sh script DESCRIPTION
atf-sh is an interpreter that runs the test program given in script after loading the atf-sh(3) library. atf-sh is not a real interpreter though: it is just a wrapper around the system-wide shell defined by ATF_SHELL. atf-sh executes the inter- preter, loads the atf-sh(3) library and then runs the script. You must consider atf-sh to be a POSIX shell by default and thus should not use any non-standard extensions. The following options are available: -s shell Specifies the shell to use instead of the value provided by ATF_SHELL. ENVIRONMENT
ATF_LIBEXECDIR Overrides the builtin directory where atf-sh is located. Should not be overridden other than for testing purposes. ATF_PKGDATADIR Overrides the builtin directory where libatf-sh.subr is located. Should not be overridden other than for testing purposes. ATF_SHELL Path to the system shell to be used in the generated scripts. Scripts must not rely on this variable being set to select a specific interpreter. EXAMPLES
Scripts using atf-sh(3) should start with: #! /usr/bin/env atf-sh Alternatively, if you want to explicitly choose a shell interpreter, you cannot rely on env(1) to find atf-sh. Instead, you have to hardcode the path to atf-sh in the script and then use the -s option afterwards as a single parameter: #! /path/to/bin/atf-sh -s/bin/bash ENVIRONMENT
ATF_SHELL Path to the system shell to be used in the generated scripts. SEE ALSO
atf-sh(3) BSD
September 27, 2014 BSD
All times are GMT -4. The time now is 05:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy