<   2014年 01月 ( 1 )   > この月の画像一覧

 

ffmpeg放り込んで活用・・・スクリプト(仮)


#!/bin/bash
FFMPEG="/usr/local/bin/ffmpeg"
FFPRESET_LOCALE="/usr/local/share/ffmpeg/"
LOG_PASS="./pass.log"
LOG_FFMPEG="ffmpeg.log"

INPUT="$1"
OUTPUT==$(basename $INPUT .ts)
[ "${OUTPUT}.ts" = "$(basename $INPUT)" ] || exit 1

#CPU_CORES=0
CPU_CORES=$(/usr/bin/getconf _NPROCESSORS_ONLN)

FORMAT="mp4"
PRESET_NAME="libx264-hq-ts.ffpreset"
VCODEC="libx264"
VCODEC_OPT_X264="-cmp chroma -flags +ilme+ildct -deinterlace -top -1"
OPT_VBRATE=":v 1024k"
OPT_ASPECT="16:9"
OPT_SIZE="hd720"

ACODEC="libfdk_aac"
ACODEC_OPT="-profile:a aac_he_v2 -signaling explicit_sbr"
OPT_ABRATE="24k"
OPT_AFRATE="44100"
OPT_ACHS="2"

FFPRESET="${FFPRESET_LOCALE}${PRESET_NAME}"
VIDEO_JOB="-f ${FORMAT} -vcodec ${VCODEC} -fpre ${FFPRESET} ${VCODEC_OPT_X264} -b${OPT_VBRATE} -s ${OPT_SIZE} -passlogfile ${LOG_PASS}"
AUDIO_JOB="-acodec ${ACODEC} ${ACODEC_OPT} -ab ${OPT_ABRATE} -ar ${OPT_AFRATE}"

${FFMPEG} -i "${INPUT}" -pass 1 -threads ${CPU_CORES} ${VIDEO_JOB} ${AUDIO_JOB} -y "${OUTPUT}.mp4" 2> ${LOG_FFMPEG} \
&& ${FFMPEG} -i "${INPUT}" -pass 2 -threads ${CPU_CORES} ${VIDEO_JOB} ${AUDIO_JOB} -y "${OUTPUT}.mp4" 2>> ${LOG_FFMPEG} \
&& rm -f pass.log*

exit 0

[PR]

  by innocenceflower | 2014-01-05 19:10 | 備忘録

SEM SKIN - DESIGN by SEM EXE