shell脚本ffmpeg在2个作业之后停止 [英] shell script ffmpeg stops after 2 jobs
本文介绍了shell脚本ffmpeg在2个作业之后停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何想法都会很棒...
这是我的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个作业之后停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文