如何在另一个powershell命令中使用输出文件?



我首先使用自动编辑器剪切不动的部分,然后使用Mp4Box添加我的介绍。

我不知道如何自动使用自动编辑器的输出到Mp4Box。

这是我目前所掌握的。

Get-ChildItem -Filter *.mp4 | ForEach -Process {mp4box -add c:intro.mp4 -cat $_ -new $a($_.BaseName + '.mp4') -force-cat && del $_ && auto-editor $a --edit_based_on motion --motion_threshold 0.000001% --no_open}

我尝试添加$a使输出成为一个变量,但这不起作用。为了测试,我把脚本颠倒了,因为Mp4Box比自动编辑器快得多。

在调用任何使用它的命令之前,必须在单独的语句中创建变量$a

Get-ChildItem -Filter *.mp4 | ForEach {
$a = $_.BaseName + '.mp4'
mp4box -add c:intro.mp4 -cat $_ -new $a -force-cat && 
del $_ &&
auto-editor $a --edit_based_on motion --motion_threshold 0.000001% --no_open
}

我还添加了一些换行符,使代码更易于阅读。

最新更新