ffmpeg: flushing output file every chunk
问题 I'm using ffmpeg to generate a sine tone in real time for 10 seconds. Unfortunately, ffmpeg seems to flush the output file only rarely, every few seconds. I'd like it to flush every 2048 bytes (=2bytes sample width*1024 samples, my custom chunk size). The output of the following script: import os import time import subprocess cmd = 'ffmpeg -y -re -f lavfi -i "sine=frequency=440:duration=10" -blocksize 2048 test.wav' subprocess.Popen(cmd, shell=True) time.sleep(0.1) while True: print(os.path