|
@@ -0,0 +1,15 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+extract_mp4_to_png()
|
|
|
|
+{
|
|
|
|
+ local bname="$(basename $1)"
|
|
|
|
+ local dname="${bname%.*}"
|
|
|
|
+ if [ -d "$dname" ]; then
|
|
|
|
+ echo "directory ($dname) already exists..."
|
|
|
|
+ return
|
|
|
|
+ fi
|
|
|
|
+ mkdir -p "$dname"
|
|
|
|
+ ffmpeg -i "$bname" -r 1 -f image2 "${dname}/%03d.png"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+extract_mp4_to_png "$1"
|
|
|
|
+
|