本文介绍了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个作业之后停止
发布评论