Page 1 of 1

Stopping VLC

Posted: 29 Jun 2011 02:58
by gamename
Hi,

I'm capturing selenium tests as they execute, and saving video records of their behavior for future analysis. That requires starting and stopping VLC via a script.

I have a batch file on win7 that starts a screen capture just fine:

Code: Select all

del C:\Users\tsmith\capture2.avi call "C:\VideoLAN\VLC\vlc.exe" ^ screen:// --one-instance ^ -I dummy --dummy-quiet ^ --screen-follow-mouse ^ --no-video :screen-fps=5 :screen-caching=300 ^ --sout "#transcode{vcodec=h264,vb=400,fps=5,scale=1,width=1024,height=768,acodec=none}:duplicate{dst=std{access=file,mux=avi,dst='C:\\Users\\tsmith\\capture2.avi}}"
Stopping the capture is tougher. If I use 'pskill' or some other process killer, the output file is corrupted. So, there needs to be a way to gently stop VLC.

The question is: How do you do tell the vlc process (started by the batch file) to quit recording?

Thanks,
-T

Re: Stopping VLC

Posted: 29 Jun 2011 12:31
by Jean-Baptiste Kempf
use rc or http interface.

Re: Stopping VLC

Posted: 29 Jun 2011 18:09
by gamename
use rc or http interface.
Thanks. I was looking at that approach. Can you point me to an example? It isn't clear how to stop a vlc process via the http interface.

TIA,
-T

Re: Stopping VLC

Posted: 29 Jun 2011 19:52
by Jean-Baptiste Kempf
use the xml requests.

Re: Stopping VLC

Posted: 29 Jun 2011 22:33
by gamename
Hi,

For the record, here is the solution. There are 2 scripts. One to start vlc screen capture, and another to stop it.

Starting script contents:

Code: Select all

del C:\Users\tsmith\capture2.avi call "C:\VideoLAN\VLC\vlc.exe" ^ screen:// --one-instance ^ -I dummy --dummy-quiet ^ --extraintf rc ^ --rc-host localhost:8088 ^ --rc-quiet ^ --screen-follow-mouse ^ --no-video :screen-fps=5 :screen-caching=300 ^ --sout "#transcode{vcodec=h264,vb=400,fps=5,scale=1,width=1024,height=768,acodec=none}:duplicate{dst=std{access=file,mux=avi,dst='C:\\Users\\tsmith\\capture2.a vi'}}"
Stopping script contents:

Code: Select all

echo quit | "C:\Program Files (x86)\Nmap\ncat.exe" localhost 8088
That's it. Thanks for the suggestions.

-T