windows下qsv转换mp4脚本

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

:: 创建保存mp4文件的目录
set "output_dir=%~dp0mp4"
if not exist "%output_dir%" mkdir "%output_dir%"

:: 遍历当前目录下的所有文件夹
for /r %%d in (.) do (
    if exist "%%d\*.qsv" (
        cd "%%d"
        :: 遍历文件夹中的所有qsv文件
        for %%f in (*.qsv) do (
            set "input_file=%%f"
            set "output_file=!input_file:.qsv=.mp4!"

            :: 检查目标mp4文件是否已经存在
            if exist "%output_dir%\!output_file!" (
                echo 文件 "!output_file!" 已存在,跳过...
            ) else (
                :: 执行ffmpeg转换命令
                ffmpeg -i "%%f" -c:v libx264 -c:a aac "%output_dir%\!output_file!"
            )
        )
        cd..
    )
)

echo 完成!
pause
posted @   从雍和宫走到电影学院  阅读(24)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示