Skip to content

Commit 78d8e42

Browse files
authored
Docker: Filter and stop FFmpeg which started in container only (#2818)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 72552d2 commit 78d8e42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Video/video.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ function exit_on_max_session_reach() {
142142

143143
function stop_ffmpeg() {
144144
while true; do
145-
FFMPEG_PID=$(pgrep -f ffmpeg | tr '\n' ' ')
145+
FFMPEG_PID=$(pgrep -f "ffmpeg -hide_banner" | tr '\n' ' ')
146146
if [ -n "$FFMPEG_PID" ]; then
147147
kill -SIGTERM $FFMPEG_PID
148148
wait $FFMPEG_PID
149149
fi
150-
if ! pgrep -f ffmpeg >/dev/null; then
150+
if ! pgrep -f "ffmpeg -hide_banner" >/dev/null; then
151151
break
152152
fi
153153
sleep ${poll_interval}
@@ -169,7 +169,7 @@ function stop_recording() {
169169
}
170170

171171
function check_if_ffmpeg_running() {
172-
if pgrep -f ffmpeg >/dev/null; then
172+
if pgrep -f "ffmpeg -hide_banner" >/dev/null; then
173173
return 0
174174
fi
175175
return 1

0 commit comments

Comments
 (0)