gpt4 book ai didi

video - 与 Shell 脚本一起使用时在哪里添加 FilterChain

转载 作者:行者123 更新时间:2023-12-04 23:16:23 25 4
gpt4 key购买 nike

我正在尝试从 mp4 视频的中间获取 jpg。我使用了这条线,它就像在一行中生成 jpg 缩略图的魅力:

ffmpeg -i input.mp4 -vcodec mjpeg -vframes 1 -an -f rawvideo -ss `ffmpeg -i input.mp4 2>&1 | grep Duration | awk '{print $2}' | tr -d , | awk -F ':' '{print $3/2}'` output.jpg
但是,我想用上面的行应用缩放和裁剪过滤器链( filter:v ),但是无论我把过滤器放在哪里,我都无法让它工作。 -filter:v "scale=720:ih*720/iw, crop=720:720:280:1000" .
我应该把它放在哪里?
我收到的错误:

At least one output file must be specified

Invalid duration specification for ss: -filter:v


请注意,这有效: ffmpeg -i fkj.mp4 -vcodec mjpeg -filter:v "scale=720:ih*720/iw, crop=720:720:280:1000" -vframes 1 -an -f rawvideo -ss 4 output.jpg

最佳答案

可以放在-vcodec mjpeg之后并将其添加到 shell ffmpeg 命令中

ffmpeg -i input.mp4 -f null - 2>&1 | grep Duration....

理想情况下,您应该使用 ffprobe input.mp4而不是 ffmpeg

关于video - 与 Shell 脚本一起使用时在哪里添加 FilterChain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34903767/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com