import os


def find_mp4_files_os(directory):
    """
    使用os.walk递归查找MP4文件。
    返回包含完整路径的文件列表。
    """
    mp4_files = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.endswith(".mp4"):
                full_path = os.path.join(root, file)
                mp4_files.append(full_path)
    return mp4_files


# 使用示例
mp4_list = find_mp4_files_os("./")
files = []
for file in mp4_list:
    files.append(file)
with open("mp4_list.txt", "w") as f:
    for file in files:
        f.write(file + ",")
