Skip to content

Instantly share code, notes, and snippets.

@roxlu
Created May 9, 2016 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roxlu/bb48d9ecb75fd600944f4208ed9892dc to your computer and use it in GitHub Desktop.
Save roxlu/bb48d9ecb75fd600944f4208ed9892dc to your computer and use it in GitHub Desktop.
#!/bin/sh
set -x
if [ ! -d ${PWD}/h264 ] ; then
mkdir h264
fi
if [ ! -d ${PWD}/r264 ] ; then
mkdir r264
fi
for f in *.mov ; do
name=${f##*/}
name=${name%.*}
input_name="${name}.mov"
output_h264_name="${name}.h264"
output_r264_name="${name}.r264"
if [ 1 == 1 ] ; then
if [ ! -f ."/h264/${output_h264_name}" ] ; then
./ffmpeg -i "${input_name}" \
-vcodec libx264 \
-an \
-bf 0 \
-bsf:v h264_mp4toannexb \
-profile:v high \
-level:v 5.1 \
-tune fastdecode \
-pix_fmt yuv420p \
"./h264/${output_h264_name}"
fi
if [ ! -f "${PWD}/r264/${output_r264_name}" ] ; then
./r264_creator --input "${PWD}/h264/${output_h264_name}" --output "${PWD}/r264/${output_r264_name}"
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment