2012年9月18日火曜日

mencoderを使い、 Everio GZ-E265の彩度上げ、60p

http://www.linuxquestions.org/questions/linux-software-2/mts-video-conversion-672091/
ここのスクリプトをさらに改造して、60pにした。
映像が、ぬるぬる動く。
#!/bin/bash


if [ ! $1 ] || [ ! $2 ] || [ ! $3 ] || [ ! $4 ]; then
echo "USAGE: Input_MTS_File Output_MP4_File Output_WAV_File Output_MPEG_File"
exit 1
fi


INFILE=$1
MP4FILE=$2
WAVFILE=$3
MPEGFILE=$4


echo $INFILE $MP4FILE $WAVFILE $MPEGFILE


file $INFILE >> convert.log
date +%F-%H:%M:%S:%N >> convert.log


# export video ONLY to an MP4 file

ffmpeg -i $INFILE -sameq -an -f yuv4mpegpipe - | yuvfps -s 60000:1001 -r 60000:1001 | ffmpeg -f yuv4mpegpipe -sameq -i - -sameq -f mp4 -r 60000/1001 $MP4FILE



file $MP4FILE >> convert.log
date +%F-%H:%M:%S:%N >> convert.log


# export audio ONLY to a WAV file
ffmpeg -i $INFILE -vn $WAVFILE


file $WAVFILE >> convert.log
date +%F-%H:%M:%S:%N >> convert.log


# merge the MP4 file and WAV file while converting 60fps to 30fps.
# NOTE: tried to do that in the first step (-r 60000/1001), but it didn't work apparently.
mencoder -of avi \
-ovc xvid -xvidencopts fixed_quant=6:vhq=4:chroma_opt:gmc \
-vf pp=al,hue=-0.0:1.4,pp=ac,yadif=1,harddup -fps 60000/1001 -ofps 60000/1001 -oac lavc \
-audiofile $WAVFILE $MP4FILE -o $MPEGFILE


file $MPEGFILE >> convert.log
date +%F-%H:%M:%S:%N >> convert.log


# END #