0

我正在编写一个个人 Python 项目来帮助我从 m3u8 文件中下载在线视频。它在 Ubuntu 20.04 上运行良好,但在 Windows 11 上 ts 文件的合并相对非常慢(5s vs <0.1s),有什么解释或方法可以解决吗?(每个 ts 文件约为 0.5MB,每个视频大约 500 个)

with open(merged, 'wb') as outfile:
    for ts_file in ts_files:
        with open(ts_file, 'rb') as infile:
            shutil.copyfileobj(infile, outfile)
            # outfile.write(infile.read()) I also tried this
4

0 回答 0