[vlc] Kill VLC

Anthony Loiseau thannoy at actech-innovation.com
Tue Mar 10 09:43:10 CET 2009


Hi,

My guess is you are testing your command lines with bash or sh. They
manage the special variable "$!" and the csh have not this special
variable (I think, I have nor csh here) set to background process ID.

- VLC 0.9+ have a "--pidfile <string> " argument, you should try it.
- you can search csh man pages to find which special variable is created
by csh for last process ID, etc
- you can set your script interpreter as bash or sh (#!/bin/sh), not
sure space is allowed between '!' and '/')


regards,
Anthony

On Mon, 2009-03-09 at 18:25 -0700, Brook Lin wrote:
> Hi All,
> 
> I am trying to close VLC after capturing the video by the web camera for
> 30sec. 
> I tried the following command in the terminal:
> vlc v4l:// :v4l-vdev="/dev/video" :v4l-adev="/dev/dsp" :v4l-norm=3
> :v4l-frequency=-1 --sout
> '#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,dst="/Desktop/myfile"}}'
> & echo $! >vlc.pid
> kill $(<vlc.pid) &
> 
> The VLC could be killed. However, if I wrote these two command to a csh
> script, and run this script. I got error 'Illegal variable name' and the VLC
> could not be closed successfully.
> #! /bin/csh
> vlc v4l:// :v4l-vdev="/dev/video" :v4l-adev="/dev/dsp" :v4l-norm=3
> :v4l-frequency=-1 --sout
> '#transcode{vcodec=mp4v,vb=1024,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ts,dst="/Desktop/myfile"}}'
> & echo $! >vlc.pid
> kill $(<vlc.pid) &
> 
> Could anyone help me with this problem? 
> 
> Appreciated,
> Brook




More information about the vlc mailing list