【问题标题】:mysterious error with ffmpeg on OSXOSX上ffmpeg的神秘错误
【发布时间】:2016-01-17 05:54:21
【问题描述】:

我的 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会以这种方式影响一个不相关的字符串?

我无能为力,任何帮助将不胜感激。

【问题讨论】:

    标签: macos bash ffmpeg


    【解决方案1】:

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

    find | while read
    do
      ffmpeg -nostdin
    done
    

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

    【讨论】:

    • 魔法,修复了它。我仍然不确定我是否理解发生了什么,但我会做一些阅读
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-03-13
    • 2017-04-20
    • 2014-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多