summaryrefslogtreecommitdiffstats
path: root/tools/video_aspect_ratio
diff options
context:
space:
mode:
Diffstat (limited to 'tools/video_aspect_ratio')
-rw-r--r--tools/video_aspect_ratio28
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/video_aspect_ratio b/tools/video_aspect_ratio
new file mode 100644
index 0000000..ac81980
--- /dev/null
+++ b/tools/video_aspect_ratio
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Date: 2009-12-04
+# Author: Ole Kristian Lien
+# License: GNU General Public License
+#
+# Show the pixel aspect ratio (PAR) for a video-file
+
+EXT=`echo "$1"|awk -F . '{print $NF}'`
+PAR=`ffmpeg -i $1 2>&1 | grep Video | cut -d "," -f 5 | cut -d " " -f 3`
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 <video-file>"
+ exit 1
+fi
+
+if [ $EXT == "dv" ] ; then
+ if [ "$PAR" == "59:54" ] ; then
+ echo "4:3"
+ elif [ "$PAR" == "118:81" ] ; then
+ echo "16:9"
+ else
+ echo "Unkown pixel aspect ratio"
+ fi
+else
+ echo "Video format not supported"
+ exit 1
+fi