better-ffmpeg-progress icon indicating copy to clipboard operation
better-ffmpeg-progress copied to clipboard

Add support for passing arbitrary file descriptors to the log

Open m-krastev opened this issue 4 months ago • 0 comments

This pull request improves the flexibility of how FFmpeg log output is handled in the better_ffmpeg_progress.py module. The main change allows the log destination to be either a file path or a file-like object, such as sys.stdout, making it easier to redirect FFmpeg logs for different use cases.

FFmpeg log output handling improvements:

  • Updated the initialization of self._ffmpeg_log_file in __init__ to support both os.PathLike objects and direct file-like objects, enabling the use of custom log destinations.
  • Modified the run method to check the type of self._ffmpeg_log_file and handle writing to either a file path or a file descriptor (e.g., sys.stdout). This ensures compatibility with various logging scenarios. [1] [2]

m-krastev avatar Sep 21 '25 16:09 m-krastev