Skip to content

Instantly share code, notes, and snippets.

@shinmiy
Created May 18, 2020 08:55
Show Gist options
  • Save shinmiy/fed984efc15d968910eac101826a9aae to your computer and use it in GitHub Desktop.
Save shinmiy/fed984efc15d968910eac101826a9aae to your computer and use it in GitHub Desktop.
つながってるAndroid端末からいい感じに動画を拾ってくるスクリプト
#!/bin/bash
DIRECTORY="/sdcard/DCIM/Camera/"
SCALE="720"
fullpath=$(adb shell exec ls ${DIRECTORY}*.mp4|peco)
filename=$(basename -- "$fullpath")
extension="${filename##*.}"
name="${filename%.*}"
adb pull $fullpath .
ffmpeg -i $filename -vf scale=-1:${SCALE} -an ${name}_${SCALE}p.${extension}
rm -i $filename
open .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment