mp42png 279 B

123456789101112131415
  1. #!/bin/bash
  2. extract_mp4_to_png()
  3. {
  4. local bname="$(basename $1)"
  5. local dname="${bname%.*}"
  6. if [ -d "$dname" ]; then
  7. echo "directory ($dname) already exists..."
  8. return
  9. fi
  10. mkdir -p "$dname"
  11. ffmpeg -i "$bname" -r 1 -f image2 "${dname}/%03d.png"
  12. }
  13. extract_mp4_to_png "$1"