优酷视频kux格式转mp4格式

太过爱你忘了你带给我的痛 2022-11-29 11:51 466阅读 0赞

感谢风雪小筑

1 安装优酷找到自带的ffmeg进行操作

  • 默认路径”C:\Program Files (x86)\YouKu\YoukuClient\nplayer\ffmpeg.exe”
  • 将nplayer文件夹整个拷贝出来
  • 在这里插入图片描述
  • $ nplayer/ffmpeg.exe -y -i 01.kux -c:a copy -c:v copy -threads 2 01.MP4

2 为了后续操作方便,添加系统变量

在这里插入图片描述
在这里插入图片描述

3 脚本批量操作

这里借用视频压缩处理之ffmpeg用法

将待处理文件kux,放到/待处理文件夹内

  1. # 该脚本的功能是, 将待压缩的文件夹内所有视频, 通过ffmpeg
  2. # 进行帧率压缩, 将压缩后的文件保存到处理完文件夹内
  3. # 执行命令为 在安装ffmpeg的系统中, python passion.py
  4. import os
  5. import sys
  6. import time
  7. # ffmpeg.exe -y -i 01.kux -c:a copy -c:v copy -threads 2 01.MP4
  8. wait_handle_dir = r"待处理/"
  9. save_dir = r"处理完/"
  10. if os.path.exists(save_dir):
  11. pass
  12. else:
  13. os.mkdir(save_dir)
  14. for file in os.listdir(wait_handle_dir):
  15. save_name = f"{os.path.splitext(file)[0]}.mp4"
  16. if save_name not in os.listdir(save_dir): # 判断文件夹内是有转化完成的数据
  17. print(f"trackle {wait_handle_dir}{file} ..................................")
  18. command = f'ffmpeg.exe -y -i "{wait_handle_dir}{file}" -c:a copy -c:v copy -threads 2 "{save_dir}{save_name}"'
  19. print(command)
  20. os.system(command)
  21. time.sleep(0.5)

发表评论

表情:
评论列表 (有 0 条评论,466人围观)

还没有评论,来说两句吧...

相关阅读