From 8bb3a23c3edf9211b558f0d4d923273d5f2c5ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Labb=C3=A9?= Date: Fri, 14 Jan 2022 15:46:48 +0100 Subject: [PATCH] 33045: adding -nostdin argument to ffmpeg command --- src/sage/plot/animate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sage/plot/animate.py b/src/sage/plot/animate.py index e3557569e78..57eeb45ce1d 100644 --- a/src/sage/plot/animate.py +++ b/src/sage/plot/animate.py @@ -956,7 +956,9 @@ def ffmpeg(self, savefile=None, show_path=False, output_format=None, # ...', need to come before the input file names, while # some options, like '-pix_fmt rgb24', need to come # afterwards. Hence 'early_options' and 'ffmpeg_options' - cmd = 'cd "%s"; sage-native-execute ffmpeg -y -f image2 %s -i %s %s %s' % (pngdir, early_options, pngs, ffmpeg_options, savefile) + # The `-nostdin` is needed to avoid the command to hang, see + # https://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background + cmd = 'cd "%s"; sage-native-execute ffmpeg -nostdin -y -f image2 %s -i %s %s %s' % (pngdir, early_options, pngs, ffmpeg_options, savefile) from subprocess import check_call, CalledProcessError, PIPE try: if sage.misc.verbose.get_verbose() > 0: