[FFmpeg-user] RES: issue with monitoring script
Pedro Daniel Costa
portalnet2 at outlook.com.br
Mon Jul 23 14:25:47 EEST 2018
Thxs for your input, it worked like a charm, managed to get te output log to stdout and with tail -f on the output file log i managed to check the issue which was a simple /path location of ffserver and config files
Now everything fully automated, It checks if its running live input, transcoding, if not it fires up ffserver and 1 min after the ffmpeg -I for live transcoding.
De: ffmpeg-user [mailto:ffmpeg-user-bounces at ffmpeg.org] Em nome de robertlazarski
Enviada em: sexta-feira, 20 de julho de 2018 21:01
Para: FFmpeg user questions
Assunto: Re: [FFmpeg-user] issue with monitoring script
On Fri, Jul 20, 2018 at 5:37 PM, Pedro Daniel Costa < portalnet2 at outlook.com.br> wrote:
> Hi guys
> I need some guidance
> I have setup a crontab
> To check every minute if a live transcoding channel has stopped.
> The script gets pulled via crontab and I can see the instance starting
> up, but then after couple of seconds it gets shutdown,
> If I run the script manually it starts both ffserver and ffmpeg input
> couple of seconds later and it run for hours/days with no problem..
> If I close the terminal where I have executed the script and let the
> crontab execute it, it start and shutdown couple of seconds after
> I have correct permissions on the script files and config files..
> Here is the ouput of the script
> Can someone help me on this as I want to make a monitoring script to
> check all the live transmission transcodings being used
> And if it crashes or stops I want the crontab to init ffserver and
> ffmpeg shortly after again
> Here is the output of the script, can someone please tell me what I am
> doing wrong? I use the same similar script to my middlware application
> to check the live multicast transmission and tunners setup from the
> PCI devices..
> # check channel transcoding
> # ffserver channel1.sh
> if ps x |grep -v grep | grep channel1.cfg ; then echo "FFserver runing
> echo "FFserver down"
> ffserver -d -f channel1.cfg
> sleep 10
> if ps x |grep -v grep | grep channel1.ffm ; then echo "Transcoder
> running "
> echo "transcoder down"
> ffmpeg -i udp://@188.8.131.52:4002
> Any hints or tips on how to setup a correct check status script will
> be appreciated.
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
Try editing your crontab so stdout / stderr go to a log file, to see the specific error - see example below. Also /var/log etc may have cron logs.
Another thing is I would use an absolute path to ffmpeg, you can find the correct path by the command 'which ffmpeg' in the shell .
You may also try putting the process in the background with an '&' at the end of your commands.
sh channel1.sh > /home/username/xxx.log 2>&1 &
You can also get some extra logging via these lines at the top of your file (after '#!/bin/bash') , and an exit on the error line.
set -o errexit
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
To unsubscribe, visit link above, or email ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user