Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Sur d’autres sites (550)

  • bash script to start/stop ffmpeg x11grab

    28 juin 2012, par lunacafu

    A 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 while ffmpeg captures, the status.txt file still has to be checked for a change to the status,
    • recording -> do nothing
    • finished -> send q command to ffmpeg process to quit capturing process and finish script.

    I tried to solve it with expect and xdotool to realize that this absolutely the wrong way. My problem is that I acutally have no experience in bash and handling processes, child processes etc.