Option -nostdin not working correctly?
Hi everyone, I want to run FFmpeg as a background process. But if you run something like the following command line, the process will bu suspended as long as FFmpeg is in the background: $ ffmpeg -y -f lavfi -i testsrc=r=1 -t 300 out.mp4& ffmpeg version 3.1.7 Copyright (c) 2000-2017 the FFmpeg developers ... [1]+ Stopped ffmpeg -y -f lavfi -i testsrc=r=1 -t 300 out.mp4 $ ls -l out.mp4 ls: cannot access 'out.mp4': No such file or directory Only after using `fg` to get the process to the foreground, FFmpeg will actually start the encoding. I have tried using the `-nostdin` option to fix that as the documentation states: -stdin Enable interaction on standard input. On by default unless standard input is used as an input. To explicitly disable interaction you need to specify "-nostdin". Disabling interaction on standard input is useful, for example, if ffmpeg is in the background process group. Roughly the same result can be achieved with "ffmpeg ... < /dev/null" but it requires a shell. But the option seems to have no effect, except for disabling the keyboard controls: $ ffmpeg -nostdin -y -f lavfi -i testsrc=r=1 -t 300 out.mp4& ffmpeg version 3.1.7 Copyright (c) 2000-2017 the FFmpeg developers ... [1]+ Stopped ffmpeg -nostdin -y -f lavfi -i ... out.mp4 $ ls -l out.mp4 ls: cannot access 'out.mp4': No such file or directory What works id to pipe /dev/null into ffmpeg like this: $ ffmpeg -f lavfi -i testsrc=r=1 -t 300 out.mp4 < /dev/null & The problem is that a shell is required for this and I do not want to start FFmpeg from a shell but from another process. Again, I can attach stdin to /dev/null in that subprocess call, but from how I interpret the docs, that is what `-nostdin` should prevent. Am I missing anything? Is that a bug in the current FFmpeg version? Best regards, Lars
2017-03-24 18:44 GMT+01:00 Lars Kiesow <lkiesow@uos.de>:
$ ffmpeg -y -f lavfi -i testsrc=r=1 -t 300 out.mp4& ffmpeg version 3.1.7 Copyright (c) 2000-2017 the FFmpeg developers
Note that this is old and that you are expected to always post command line and complete, uncut console output when asking for support.
... [1]+ Stopped ffmpeg -y -f lavfi -i testsrc=r=1 -t 300 out.mp4 $ ls -l out.mp4 ls: cannot access 'out.mp4': No such file or directory
Only after using `fg` to get the process to the foreground, FFmpeg will actually start the encoding.
I have tried using the `-nostdin` option to fix
FFmpeg can accept stdin for control, this disables it (and seems unrelated to your isssue). [...]
Is that a bug in the current FFmpeg version?
(The question is misleading given the age of the version you test.) Since this behaviour exists since at least 2009, I don't think so. Carl Eugen
participants (2)
-
Carl Eugen Hoyos -
Lars Kiesow