
Recherche avancée
Sur d’autres sites (550)
-
bash script to start/stop ffmpeg x11grab
28 juin 2012, par lunacafuA application is storing its status in a file on the server
/temp/status.txt
. There are 4 status possible :wait
,ready
,recording
,finished
. With a cronjob I would like to start a shell script that checks this file and take action as follows :- wait -> do nothing
- ready -> execute
ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
. Now whileffmpeg
captures, the status.txt file still has to be checked for a change to the status, - recording -> do nothing
- finished -> send
q
command toffmpeg
process to quit capturing process and finish script.
I tried to solve it with
expect
andxdotool
to realize that this absolutely the wrong way. My problem is that I acutally have no experience inbash
and handling processes, child processes etc.