Hi,
I am using the following code to run ffmpeg in tornado:
-------------------------------------------------
cmd = ["/usr/bin/ffmpeg", "-threads", "2", "-f", "lavfi", "-i", "anullsrc=r16000:cl=stereo", "-re", "-i", "/dev/video0", "-c:a", "aac", "-strict", "experimental", "-b:a", "128k", "-ar", "44100", "-s", "640x480", "-vcodec", "libx264", "-x264-params", "keyint=120:scenecut=0", "-vb", "200k", "-pix_fmt", "yuv420p", "-f", "flv", "rtmp://
a.rtmp.youtube.com/live2/<key>"]
self.__streaming_process = Subprocess(cmd, stdout=Subprocess.STREAM)
self.__streaming_process.set_exit_callback(self.__ffmpeg_closed)
IOLoop.instance().add_timeout(time.time() + 10, self.do_fulfill_stop_streaming)
while True:
line = await self.__streaming_process.stdout.read_until(b"\n")
if not line:
self.logger.debug("nothing to show")
await asyncio.sleep(.2)
else:
print(line)
pass
---------------------------------------------------------------------------------------------
When i use a similar code for a different Linux process i get new values for the line inside the while loop but for FFmpeg, it just gits once and then does not go to the next line. But in the IDE i see the FFmpeg output tin red as if everything is normal. but the reality is i am not capturing stdout or stderr into my own variable at all. is this a blocking way of writing subprocess or something? Any help is appreciated.
Regards