shell脚本ffmpeg在2个作业之后停止

编程入门 行业动态 更新时间:2024-10-17 00:27:31
本文介绍了shell脚本ffmpeg在2个作业之后停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有一个非常简单的shell脚本,在做了前两个工作之后,它只是停下来坐在那里,不做任何事情,它似乎不关心第三个工作是什么,如果我切换订单等,它不会完成它。

任何想法都会很棒...

这是我的shell脚本

for$ @ do name = $(basename$ f) dir = $(dirname$ f) / opt / local / bin / ffmpeg -i$ f-y -b 250k -deinterlace -vcodec vp8 -acodec libvorbis -nostdin$ dir / webm / $ {name%。*}。webm / opt / local / bin / ffmpeg -i$ f-y -b 250k -strict experiment -deinterlace -vcodec h264 -acodec aac -nostdin$ dir / mp4 /${name%.*}.mp4 / opt / local / bin / ffmpeg -i$ f-y -ss 00:00:15.000 -deinterlace -vcodec mjpeg -vframes 1 -an -f rawvideo -s 720x480$ dir / img / $ {name%。*}。jpg done

解决方案

您的最终 ffmpeg 行需要 -nostdin p>

从Shell脚本/ bin / sh 运行FFMPEG

I have a pretty simple shell script and after doing the first two jobs, it just stops and sits there, doesnt do anything, it doesnt seem to matter what the third job is, if I switch the order etc, it will not finish it.

Any ideas would be great...

Here is my shell script

for f in "$@" do name=$(basename "$f") dir=$(dirname "$f") /opt/local/bin/ffmpeg -i "$f" -y -b 250k -deinterlace -vcodec vp8 -acodec libvorbis -nostdin "$dir/webm/${name%.*}.webm" /opt/local/bin/ffmpeg -i "$f" -y -b 250k -strict experimental -deinterlace -vcodec h264 -acodec aac -nostdin "$dir/mp4/${name%.*}.mp4" /opt/local/bin/ffmpeg -i "$f" -y -ss 00:00:15.000 -deinterlace -vcodec mjpeg -vframes 1 -an -f rawvideo -s 720x480 "$dir/img/${name%.*}.jpg" done

解决方案

Your final ffmpeg line needs -nostdin.

Running FFMPEG from Shell Script /bin/sh

更多推荐

shell脚本ffmpeg在2个作业之后停止

本文发布于:2023-10-09 05:45:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1474869.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:作业   脚本   shell   ffmpeg

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!