summaryrefslogtreecommitdiffstats
path: root/scripts/tst.aspect
diff options
context:
space:
mode:
authorvan <[email protected]>2008-08-08 06:19:54 +0000
committervan <[email protected]>2008-08-08 06:19:54 +0000
commitf8eb63aed0df0e9c99b5d652728ccb01a2d4eb68 (patch)
tree5a2a0a1e1200b8e41c78b66349001f398befc4f2 /scripts/tst.aspect
parent138aa5d206ae6ee6296948367de807089f414f6a (diff)
- change aspect from a scaled int to a double so we can handle the wider
range of aspect ratios we get from ffmpeg files. - add container_aspect to title struct (always zero except for DVDs when it's the aspect from the VTSI). To handle broken French DVDs, make HB complain & use the container aspect if it's different from the aspect computed from the video PAR. - fix ScanFunc's job template init so that it doesn't think the only legal aspect ratios are 16:9 & 4:3. - hb_reduce wouldn't reduce any fraction where both terms were equal and prime (e.g., 2/2, 3/3, 5/5, etc. would not become 1/1). Recoded it using Euclid's Algorithm so it always works and is faster. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1616 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'scripts/tst.aspect')
-rwxr-xr-xscripts/tst.aspect34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/tst.aspect b/scripts/tst.aspect
new file mode 100755
index 000000000..64d58d7b7
--- /dev/null
+++ b/scripts/tst.aspect
@@ -0,0 +1,34 @@
+#!/bin/tcsh
+#
+# generate aspect ratio & cropping regression test data
+# from a set of HandBrake input files
+#
+# usage: tst.aspect [file ...]
+#
+# if no file names are supplied a default set of inputs is used (see the
+# variable 'inputs' below). Each file is encoded multiple times using
+# different options each time. The options to use are the elements of
+# the 'options' variable below.
+#
+# One line is printed for each HB run. It has the input dimensions,
+# output dimensions, crop, PAR, filename & options for the encode.
+# Since PAR is only output for anamorphic encodes, an omitted PAR
+# is indicated by "1:1" (to distinguish it from the explicit PAR "1/1").
+
+set options=('-w 480' '-l 368' '-p' '-P')
+
+if ($#argv) then
+ set inputs=($argv:q)
+else
+ set inputs=(~/Movies/DVD/* ~/tst/*.{ts,mpg,mkv,avi,vob})
+endif
+
+foreach i ($inputs:q)
+ foreach o ($options:q)
+ (sleep 5; echo q) | ./HandBrakeCLI -v -L -i "$i" -o /dev/null -f mp4 -e x264 $o |& \
+ awk -v fnm="$i" -v opts="$o" '/ storage dimensions: / { dimen = $5 "*" $7 " -> " $9 "*" $11 " " $13 }\
+ $3=="dimensions:" { dimen = $4 "*" $6 " -> " $8 "*" $10 " " $12 }\
+ / pixel aspect ratio: / { par=$6 "/" $8 }\
+ /encx264: opening libx264/ { if(! par) par="1:1";printf "%s %s %s %s\n", dimen, par, fnm, opts }'
+ end
+end