LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-16-2014, 04:23 PM   #1
tonj
Member
 
Registered: Sep 2008
Posts: 406

Rep: Reputation: 24
SOLVED: startup script will not start process


I'm running centos 6 svr 64 bit (command line only)

this (long) command in a console starts ffmpeg and it runs fine:
Quote:
/root/bin/ffmpeg -i "rtmp://<ip-camera>" -f flv -r 10 -s 640x360 -vcodec libx264 -preset veryfast -crf 35 -c:a libfdk_aac -ac 1 -ab 32k "rtmp://<red5-server>"
and if I transplant this same command into a startup script in /etc/init.d it also works fine:

Quote:
#!/bin/sh
### BEGIN INIT INFO
# Provides: stream
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: start ffmpeg
### END INIT INFO

SCRIPT="/root/bin/ffmpeg -i "rtmp://<ip-camera>" -f flv -r 10 -s 640x360 -vcodec libx264 -preset veryfast -crf 35 -c:a libfdk_aac -ac 1 -ab 32k "rtmp://<red5-server>"
RUNAS=root

PIDFILE=/var/run/stream.pid
LOGFILE=/var/log/stream.log
(snip>

Now if I add text overlay to the command (shown here in bold) and run it in a console the command starts ffmpeg and it runs fine:
Quote:
/root/bin/ffmpeg -i "rtmp://<ip-camera>" -f flv -r 10 -s 640x360 -vcodec libx264 -preset veryfast -crf 35 -c:a libfdk_aac -ac 1 -ab 32k -vf drawtext="fontfile=/usr/share/fonts/truetype/arialbd.ttf: text='my_text_here':fontsize=20:fontcolor=white:x=30:y=310" "rtmp://<red5-server>"
but if I transplant this same command into the start script in /etc/init.d like I did before, then ffmpeg won't start. In the log I get:
Trailing options were found on the commandline
Can anyone see what the problem is and why the startup script doesn't like the text overlay addition?

Last edited by tonj; 05-16-2014 at 04:55 PM. Reason: solved
 
Old 05-16-2014, 04:54 PM   #2
tonj
Member
 
Registered: Sep 2008
Posts: 406

Original Poster
Rep: Reputation: 24
SOLVED: startup script will not start process

I found it, the command in the script needed a '-y' on the end of the text overlay addition thus:
...fontcolor=white:x=30:y=310" -y "rtmp://<red5-server>"
and now it works fine.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Process dies when launched in system startup script carpannav Linux - Server 0 07-16-2013 11:44 AM
How can I check which script start process konzo Linux - Software 6 09-08-2010 09:47 PM
Controlling which process start automatically at startup austinium Linux - Newbie 4 03-11-2008 07:31 PM
Script to see if a process ir running, if not start it ncsuapex Programming 4 07-03-2005 01:27 PM
How to make a programm to start at the end of startup process ayachi Linux - Software 1 04-15-2004 10:31 AM


All times are GMT -5. The time now is 07:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration