26

I record my program until it closes.

Start Command:

cvlc screen:// --screen-left=0 --screen-top=0 --screen-width=1280 --screen-height=960 --screen-fps=30 \
--sout '#transcode{vcodec=mp2v, vb=800, scale=1, acodec=none}:file{mux=ts, dst=your_video_path_to_be_saved}'

Stop Command:

kill -9 pgrep vlc

That works well, now I need to implement pause method to this program. I need to kill program at pause method then start it on resume method and append new video to older one. How can i do it?

VLC Wiki: Merge

Ulfsark
  • 902
  • 1
  • 11
  • 26

2 Answers2

57

To pause the process

kill -STOP <PID>

To resume it

kill -CONT <PID>
Arnab Nandy
  • 6,472
  • 5
  • 44
  • 50
  • 3
    Just for pedantry, the signal names this sends to the process in question are SIGSTOP and SIGCONT. – pmarreck Nov 17 '21 at 16:17
19

Ctrl + z (SIGTSTP) from the shell stops (nowaday we will probably use the term "suspend", which the man page of bash does) a process. The process can be continued ("resumed") with the commands fg (in foreground) or bg (in background).

kill -9 doesn't stop a process, it kills it (SIGKILL). I mention it, because wording here is ambiguous.

Georgy
  • 12,464
  • 7
  • 65
  • 73
Peter
  • 2,240
  • 3
  • 23
  • 37