A
A
alexdora2017-11-13 15:14:00
linux
alexdora, 2017-11-13 15:14:00

How to pass a keystroke to a background process?

Runs via nohup - ffmpeg
To kill ffmpeg you can use kill, but it's better to use the Q key because I work with rtmp streams where apparently a final frame is sent that says that the stream has ended and free up space on the point. In general, if you do a kill, then the stream still remains on the receiver server for 30 seconds (apparently, some kind of timeout is waiting and restarting is a big problem.
In this regard, the question is:
How to transfer a keystroke to a specific process with ffmpeg (for example, by ID). Process there is not one.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2017-11-13
@alexdora

Try sending SIGINT (same as ctrl+c, which seems to do the same as q)
kill -s SIGINT

R
res2001, 2017-11-13
@res2001

For Windows, to send key combinations to a window, you can use utilities like autoit, nircmd.
nircmd is easier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question