在OSX上使用ffmpeg的神秘错误 [英] mysterious error with ffmpeg on OSX

查看:201
本文介绍了在OSX上使用ffmpeg的神秘错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的bash脚本中似乎有一个错误,很久以来我设法将其减少到这个测试用例:

  find。 -maxdepth 1 | while read blah 
do
echo$ blah
ffmpeg -loglevel error -i ./test.jpg -f null / dev / null

done

此输出是

  /test.jpg 
/test.mp4
/test.sh

如果我删除ffmpeg调用,输出将成为这个(我预期的):

  ./ test。 jpg 
./test.mp4
./test.sh

仅当ffmpeg解码器被激活时才会发生,因为ffmpeg -version不会产生错误。为什么ffmpeg会以这种方式影响一个无关的字符串?



我在机智的结束,任何帮助将不胜感激。

解决方案

FFmpeg正在吃你的标准输入。这样做:

  find |同时阅读
do
ffmpeg -nostdin
done

在shell脚本中创建ffmpeg循环中的丢失一些迭代


There seems to be a bug in my bash script, and after a long time I managed to reduce it to this test case:

find . -maxdepth 1 | while read blah
do
    echo "$blah"
    ffmpeg -loglevel error -i ./test.jpg -f null /dev/null

done

the output from this is

/test.jpg
/test.mp4
/test.sh

if I remove the ffmpeg invocation, the output becomes this (what I expected):

./test.jpg
./test.mp4
./test.sh

this seems to occur only when the ffmpeg decoder is activated, as ffmpeg -version doesn't produce the error. Why would ffmpeg affect an unrelated string in this way?

I'm at my wit's end, any help would be appreciated.

解决方案

FFmpeg is eating your standard input. Do like this instead:

find | while read
do
  ffmpeg -nostdin
done

Creating forks of `ffmpeg` in loop inside a shell script "loses" some iterations

这篇关于在OSX上使用ffmpeg的神秘错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆