Skip to content

Instantly share code, notes, and snippets.

@8q
Created July 21, 2019 03:39
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 8q/6289b0b67da103f019ccd0c9fde6c812 to your computer and use it in GitHub Desktop.
Save 8q/6289b0b67da103f019ccd0c9fde6c812 to your computer and use it in GitHub Desktop.
m2ts -> mp4バッチ
#!/bin/bash
if [ $# -lt 1 ]; then
echo 'Usage: $ ./batch.sh input_dir'
exit 1
fi
find $1 -type f |
grep -E "\.m2ts$" |
sed 's/\.m2ts$//g' |
xargs -I{} \
ffmpeg -y -i {}.m2ts \
-c:v libx264 \
-s 1280x720 \
-aspect 16:9 \
-vsync 1 \
-movflags +faststart \
-crf 26 \
-tune animation \
{}.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment