Closed blueset closed 4 years ago
Attempted to stream I/O with FFmpeg with stdin
and stdout
. This strategy said to be only working with a few encodings. It seems that Telegram GIF (MP4, h264, soundless) luckily felt in that range.
Haven't tested on a real NT environment (as I don’t currently have one). If the issue persists, reopen this issue and leave a comment with full trackback, and I will take a look if I can.
As documented in Python docs, due to the architecture design of Windows NT and later, despite the full file name is provided,
NamedTemporaryFile
cannot be reopened by its name again either within the same process or not.EFB Telegram Master channel (ETM) currently strongly relies on external packages and programs like
libmagic
andffmpeg
to detect file type and re-encode media files. This restriction imposed by Windows prevents us from performing those actions. Meanwhile we haven’t managed to discover a way to let external programs to accept file handles from Python.So here I’d like to seek help on this issue to allow external programs to access those temporary files while keeping its “lifecycle” feature — to delete the file automatically upon closing it.