Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # 引数を走査し -vf を見付けた場合、その左側に -sws_flags neighbor を
- # 追加して ffmpeg を呼び出す
- # このファイルに実行権限を付与:
- # chmod a+x ffmpeg_neighbor.sh
- # vichan でこのスクリプトを使ってサムネイルを生成させる
- # vichan/inc/instance-config.php
- # $config['webm']['ffmpeg_path'] = '/path/to/ffmpeg_neighbor.sh';
- # 実行権限の付与が面倒くさい場合は
- # $config['webm']['ffmpeg_path'] = 'bash -- /path/to/ffmpeg_neighbor.sh';
- # 設定値: ffmpeg 実体を指定
- real_ffmpeg_command=ffmpeg
- function f() {
- local -a args=( "$@" )
- local index=0
- for ((index=0; index < "${#args[@]}"; ++index)); do
- if test '-vf' '=' "${args[index]}"; then
- args=("${args[@]:0:$index}"
- '-sws_flags' 'neighbor'
- "${args[@]:$index}")
- break
- fi
- done
- "$real_ffmpeg_command" "${args[@]}"
- }
- f "$@"
- # ---- vichan に default body を設定する
- # vichan/inc/instance-config.php
- #
- # event_handler('post', function($post) {
- # if ($post->body == '') {
- # # pixiv, Windows IME(?), たぶん old school
- # $post->body = 'キタ━━━━(゚∀゚)━━━━!!';
- # # # may, dec, jun
- # # $post->body = 'キタ━━━(゚∀゚)━━━!!';
- # # # img
- # # $post->body = 'キタ━━━━━━(゚∀゚)━━━━━━ !!!!!';
- # };
- # });
- # ----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement