タグ

Shellとprogrammingに関するsirocco634のブックマーク (2)

  • All commands

    The 30 means start extracting frames from 30 seconds into the video. The 3 means extract the next 3 seconds from that point. The fps can be adjusted based on your preferences. The 320 is the width of the gif, the height will be calculated automatically. input.mp4 is the video file, which can be any video file ffmpeg supports. The output.gif is the gif created. ffmpeg -ss 30 -t 3 -i input.mp4 -vf "

  • コマンドが失敗したらプロンプトを赤くする - blog.8-p.info

    しばらく前から、コマンドの終了ステータスをプロンプトの色に反映させるようにしている。 終了ステータスとは C言語なら int main(int argc, char* argv[]) { ... return 0; } この return している 0 が終了ステータス。この整数値の下位 8bit がプロセスの終了時に親 (そのプロセスを起動したプロセス) にわたる。 終了ステータスの指定方法はいろいろある。C言語の場合 main 関数の戻り値以外にも exit 関数の引数でも指定できる。Ruby, Perl の場合、そもそも main 関数は無くて exit 関数に引数を与える方法だけがつかえる。 この値はシェル上で $? で参照できる。 % perl -e 'exit(0xdead)'; echo $? 173 % 慣例として、正常終了のときは 0 を返すことになっている。 % ls

    sirocco634
    sirocco634 2009/01/04
    さっそく設定してみた。すてきだ♪
  • 1