|
xine or VLC Playing video files after being triggered by a CLI RS-232 input
Hi - (Long time reader, first time asker...)
Here is my issue. I am working with a Community access TV Station. (Read "Free TV" or "Wayne's World" for the Non US readers.) and we are trying to broadcast from a computer. I, of course, chose linux for the box in question, mostly because it needs to run 99.9999 of the time, and I needed the scriptability.
So, We have a CentOS 5.3 box running on a home built quad core w/ 8GB ram and a GeForce FX 5200 for a vid card. It has s-vidio and DVI-I ports. It is now connected to a standard VGA monitor (via a DVI to VGA adapter) and a TV studio monitor (via an s-video to RCA adapter that will go straight to an s-video switcher in production.) Currently, I am running this crappy little script listening to /dev/ttyS0;
#!/bin/bash
while [ -e "/service/play_vid/run" ]
echo $$ > /usr/bin/play_vid.pid
do
read FILE < /dev/ttyS0
playing $FILE
killall xine
xine -pfhq --no-splash --no-logo $FILE&
done
rm -f /usr/bin/play_vid.pid
It works, but has many shortcomings. (once started it can't be stopped, panics on certain sized files, can't start midway through, can't be started via init'd or djb's daemon tools, etc.) What I would /like/ to so is replace xine with vlc. That would give many of the items I want right from it's command line, the only problem I am running into is that I can't make it run inside a script, only directly from a command line. (Where it works just fine.) The real thing I need, more than anything, is for this thing to start unattended on boot.
WTF am I doing wrong, or, is there a better solution?
(I am also having dual-head issues, and am, honestly wondering if that is somehow related.)
FYI, This is the command used to trigger the playback from another machine.
echo /mnt/video_bins/pub/p-earth_talk-Matthew_Preston-123-20090418-300.mkv > /dev/ttyS1
(/dev/ttyS1 is the port on the machine connected to the video play machine via a null-modem cable. this is simulating a piece of TV broadcast hardware that also sends a small string via an RS-232 port.)
Thanks for any insight you might have...
Paul
Last edited by PaulGraham; 06-21-2009 at 01:09 PM.
Reason: Added script
|