Reputation: 777
If I have multiple ffmpeg running in the background, for example:
process 1
ffmpeg -re -i "https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8" -filter_complex "null" -acodec aac -vcodec libx264 -f flv ./videos/cut-videos/standard/happens.mp4
process 2
ffmpeg -re -i "https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8" -filter_complex "null" -acodec aac -vcodec libx264 -f flv ./videos/cut-videos/standard/happens2.mp4
process 3
ffmpeg -re -i "https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8" -filter_complex "null" -acodec aac -vcodec libx264 -f flv ./videos/cut-videos/standard/happens3.mp4
How Can I end process 3 specifically?
Upvotes: 0
Views: 189
Reputation: 134313
You can use pgrep
alone to get the PID:
pgrep -f happens3.mp4
Example with kill
:
kill "$(pgrep -f happens3.mp4)"
Upvotes: 2
Reputation: 33
Try this
ps -ef | grep happens3.mp4 | awk '{ print $2 }'
This should give you the PID to that exact process.
For this example, let's say your PID is 1234.
To kill it, run the following
kill 1234
Upvotes: 1