youtube-dl 的 Powershell 脚本

标签 powershell ffmpeg youtube-dl

我正在尝试编写一个脚本来简化对 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 收到的结果:
Powershell screenshot

最佳答案

您假设 youtube-dl 的输出是文件名,仅此而已。

关于youtube-dl 的 Powershell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60009975/

相关文章:

Powershell检查变量是否为对象

c++ - ffmpeg(libavcodec)。 avcodec_encode_video 中的内存泄漏

youtube-dl 下载位置

FFmpeg 应用多个过滤器( Logo 叠加、亮度变化和文本叠加)

bash - youtube-dl问题(脚本)

php - 如何以编程方式检查 .mp4 文件是否未损坏且未丢失电影帧或音频片段

powershell - 如何使用powershell脚本保持2个文件夹同步

powershell - 使用 powershell 命令处理用户名中的撇号(单引号) - Get-Azureaduser

windows - 如何在 powershell 中关闭 Windows 窗体?

ruby-on-rails - 在 Rails 3.2.6 中使用 Paperclip-FFMPEG 从视频中获取元数据