TL,DR: I cannot get VLC to run from a cron job in any way. If someone else can, could they tell me how so I can try please!
I'm quite new to Linux + Pi so having worn out hits on Google, I'm stuck for what to do.
I'm trying to get my Pi to run a bash script at boot using a cron job. The script starts raspivid, then streams it with VLC:
"Start_Stream.sh"
Code: Select all
#!/bin/bash
/usr/bin/raspivid -o - -t 0 -fps 25 -w 1280 -h 720 -g 5 -b 10000000 -awb off | /usr/bin/cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
echo "test" > /home/pi/test.txtHowever, I CANNOT get it, or anything involving VLC to run via a cron job. Just running that script via a cron job results in test.txt being created but no evidence of raspivid or vlc being run (ps axg...). If I take off the second part of the main function, so I just have the raspivid bit, it works as a cron job.
...So this works:
Code: Select all
#!/bin/bash
/usr/bin/raspivid -o - -t 0 -fps 25 -w 1280 -h 720 -g 5 -b 10000000 -awb off
echo "test" > /home/pi/test.txtSo I tried removing the pipe thing as follows. This runs the raspivid bit, but not the VLC bit:
Code: Select all
#!/bin/bash
/usr/bin/raspivid -o - -t 0 -fps 25 -w 1280 -h 720 -g 5 -b 10000000 -awb off
/usr/bin/cvlc stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
echo "test" > /home/pi/test.txtI've tried the method detailed here, using my own .flv file: http://michaelchrisco.com/wiki/index.ph ... a_cron_job but that still refuses to run. I'm checking using ps axg and with all these tests, I just scheduling with crontab -e so they run at that point, not on reboot, for example:
Code: Select all
33 13 * * * bash /home/pi/Start_Stream4.shCode: Select all
#!/bin/bash
/usr/bin/screen -d -m /usr/bin/vlc-wrapper /home/pi/bluetit.flv --novideo --volume 700 --repeat --rc-fake-tty
echo "test" > /home/pi/test.txt
I've also tried creating VLC bash scripts that should convert a file and save it as a new file. If the file is there VLC has run. Again, these run through the CLI, but not through a cron job.
I'm completely stuck for what to do and am clueless as to why it wouldn't work. As you can imagine, I've tried various permutations of the above tests but not once has VLC run from a cron job.
Thanks in advance for any suggestions or advice. I suppose what would be really useful is if someone could get VLC running from a cron job, then I can try to replicate to find the problem.
Thanks,
David.
Edit: I'm using "2013-09-25-wheezy-raspbian"