I have a virtual machine running CentOS 5.5 that I use as a streaming server.
If I open 4 terminals and do this:
terminal 1:
# mkfifo pipe1.avi
# mkfifo pipe2.avi
# ffserver &
# ffmpeg -probesize 164000 -i pipe1.avi -async 1 -r 25 http://localhost:8090/feed1.ffm
terminal 2:
# ffmpeg -i pipe2.avi -async 1 -r 25 -vcodec flv -f flv somename.flv
terminal 3:
# mplayer -dumpstream rtp://someIp:somePort -dumpfile pipe1.avi
terminal 4:
# mplayer -dumpstream rtp://someIp:somePort -dumpfile pipe2.avi
Everything is working great. No problems nowhere.
Now I'm trying to make a script and run it from a cron. This is the script:
ffserver &
ffmpeg -probesize 164000 -i pipe1.avi -async 1 -r 25 http://localhost:8090/feed1.ffm &
ffmpeg -i pipe2.avi -async 1 -r 25 -vcodec flv -f flv somename.flv &
mplayer -dumpstream rtp://someIp:somePort -dumpfile pipe1.avi &
mplayer -dumpstream rtp://someIp:somePort -dumpfile pipe2.avi &
exit 0
The crontab line is:
10 * * * * script.sh > /dev/null 1>&2
The problem is that when the cron is run, the system crashes Actually, it doesn't really crash the stream, which I see from another computer and is working perfectly. But, I can't do anything on the machine. The screen becomes black and I can't do anything except restart it. I have a script that kills the anterior processes. If I use it the stream stops, but I still don't regain access to the system (same black screen whatever I do).
1 Answers