FFMPEG - 批量转换的子文件夹 [英] FFMPEG - Batch convert subfolders

查看:2297
本文介绍了FFMPEG - 批量转换的子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个Windows批处理文件进行转换了一些使用FFMPEG MP4文件。有一些在多个子文件夹中的文件,所以我需要的脚本在每个子文件夹中的每个文件执行。

I am trying to set up a Windows batch file to convert a number of MP4 files using FFMPEG. There are a number of files in multiple subfolders, therefore I need the script to execute on each file in each subfolder.

我怕我没有使用批处理文件但是从我的研究,我已经得到了以下命令文本的很多经验:

I'm afraid I don't have much experience of using batch files but from my research I've got the following command text:

FOR %%i in (*.mp4) /R DO (ffmpeg32 -i "%%~ni.mp4" -map 0:0 -map 0:1 -map 0:1    -c:v copy   -c:a:0 aac -b:a 128k -ac 2 -strict -2 -cutoff 15000  -c:a:1 copy "%~ni&(2).mp4")

该脚本基本上需要一个AAC音频流添加到现有的MP4文件,所以我需要通过添加改变输出名称(2)在文件名末尾。

The script basically needs to add an AAC audio stream to an existing MP4 file, therefore I need to change the output name by adding a (2) at the end of the filename.

我测试过的ffmpeg的命令分开太高兴了,它的工作原理 - 我只需要得到正确的批处理命令

I've tested the ffmpeg command separately so happy that it works - I just need to get the correct batch commands.

预先感谢任何指针!

干杯

推荐答案

试试这个:

@echo off & setlocal
FOR /r %%i in (*.mp4) DO ffmpeg32 -i "%%~fi" -map 0:0 -map 0:1 -map 0:1 -c:v copy -c:a:0 aac -b:a 128k -ac 2 -strict -2 -cutoff 15000 -c:a:1 copy "%%~dpni(2)%%~xi"

这篇关于FFMPEG - 批量转换的子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆