我正在尝试编写一个脚本来简化对 youtube-dl
的变量输入。 .
这是我的ffmpeg
命令(替换括号中的项目):
./ffmpeg -ss ['starting time', ex: 05:49] -i $(./youtube-dl -f 22 --get-url ['video youtube url']) -t ['clip duration in seconds'] -c:v copy -c:a copy ['file result name'].mp4
这是我的 PowerShell 命令:cls
$url = Read-Host -Prompt "Enter the Youtube Video URL"
$start = Read-Host -Prompt "Enter the video start time (H:MM:SS)"
$end = Read-Host -Prompt "Enter the clip duration in seconds"
$name = Read-Host -Prompt "Enter the video name"
./ffmpeg -ss $start -i $(./youtube-dl -f 22 --get-url $url) -t $end -c:v copy -c:a copy $name.mp4
这是我从 Powershell 收到的结果:最佳答案
您假设 youtube-dl 的输出是文件名,仅此而已。
关于youtube-dl 的 Powershell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60009975/