Page 1 of 1
command line question
Posted: 30 Jul 2009 23:06
by zapdafish
I am trying to write a program that uses VLC to convert a batch of movies to flash videos. My problem is the executable seems to spawn a separate process so that I am unable to detect that it has finished. Anyone got a way to prevent this from happening?
thanks
Re: command line question
Posted: 31 Jul 2009 11:06
by thannoy
When starting VLC from a batch file for example, each line are executed one after the other so it is ok (when VLC closes itself, but there is vlc://quit for that)
Using another way to launch VLC, it depends the way you launch VLC. You should be able to find a way to launch it as your needs (maybe system() command in C language or other)
You can otherwise try to use either
- --pidfile filename option. VLC will write its process id into this file and you can probably check if this ID it running or not from time to time
- look at souted file and check when it stops growing or when it is accessible with fopen
Re: command line question
Posted: 31 Jul 2009 11:15
by kryptonite
In Java, you could use the Runtime & Process classes to spawn a process and then check the state/wait for it to complete.